Skip to main content
added 1112 characters in body
Source Link
Jonathan Allan
  • 115.4k
  • 8
  • 68
  • 293

Jelly, 33 bytes

ỴḊḲ€Ṫ€K⁾;,yṖ“{“};”j ỴḢḟØDṖ,⁾ =,ÇK 

TryItOnline

How?

ỴḊḲ€Ṫ€K⁾;,yṖ“{“};”j - Link 1, parse and reform the values, same input as the Main link Ỵ - split on line feeds Ḋ - dequeue (remove the first line) Ḳ€ - split each on spaces Ṫ€ - tail each (get the numbers with trailing ';') K - join on spaces ⁾;, - ";," y - map (replace ';' with ',') Ṗ - pop (remove the last ',') “{“};” - list of strings ["{","};"] j - join (making "{" + "n0, n1, ,n2, ..." + "};") ỴḢḟØDṖ,⁾ =,ÇK - Main link, takes one argument, the multiline string Ỵ - split on line feeds Ḣ - head (just the first line) ØD - digits yield "0123456789" ḟ - filter out Ṗ - pop (remove the trailing ';') , , - pair ⁾ = - the string " =" Ç - call the previous Link (1) K - join on spaces (add the space after the '=') 

Jelly, 33 bytes

ỴḊḲ€Ṫ€K⁾;,yṖ“{“};”j ỴḢḟØDṖ,⁾ =,ÇK 

TryItOnline

Jelly, 33 bytes

ỴḊḲ€Ṫ€K⁾;,yṖ“{“};”j ỴḢḟØDṖ,⁾ =,ÇK 

TryItOnline

How?

ỴḊḲ€Ṫ€K⁾;,yṖ“{“};”j - Link 1, parse and reform the values, same input as the Main link Ỵ - split on line feeds Ḋ - dequeue (remove the first line) Ḳ€ - split each on spaces Ṫ€ - tail each (get the numbers with trailing ';') K - join on spaces ⁾;, - ";," y - map (replace ';' with ',') Ṗ - pop (remove the last ',') “{“};” - list of strings ["{","};"] j - join (making "{" + "n0, n1, ,n2, ..." + "};") ỴḢḟØDṖ,⁾ =,ÇK - Main link, takes one argument, the multiline string Ỵ - split on line feeds Ḣ - head (just the first line) ØD - digits yield "0123456789" ḟ - filter out Ṗ - pop (remove the trailing ';') , , - pair ⁾ = - the string " =" Ç - call the previous Link (1) K - join on spaces (add the space after the '=') 
Source Link
Jonathan Allan
  • 115.4k
  • 8
  • 68
  • 293

Jelly, 33 bytes

ỴḊḲ€Ṫ€K⁾;,yṖ“{“};”j ỴḢḟØDṖ,⁾ =,ÇK 

TryItOnline