Skip to main content
deleted 78 characters in body
Source Link
wen1k
  • 53
  • 6

Lua, 205 187 bytes

load("t=".. ....."c=#t for i=1,c do c=math.max(c,#t[i])end p=io.write p'{'for i=1,c do for j=1,c do _=j==1 and p'{'p(t[i]and t[i][j]or 0)p(j==c and'}'or',')end _=i~=c and p','end p'}'")()

Try it online!Try it online!

Human readable code:

load(
  "t=".. .....
  "c=#t
   for i=1,c do
     c=math.max(c,#t[i])
   end
   p=io.write
   p'{'
   for i=1,c do 
     for j=1,c do
       _=j==1 and p'{'
       p(t[i]and t[i][j]or 0)
       p(j==c and'}'or',')
     end
     _=i~=c and p','
   end
   p'}'
  ")
()

Lua, 205 187 bytes

load("t=".. ....."c=#t for i=1,c do c=math.max(c,#t[i])end p=io.write p'{'for i=1,c do for j=1,c do _=j==1 and p'{'p(t[i]and t[i][j]or 0)p(j==c and'}'or',')end _=i~=c and p','end p'}'")()

Try it online!

Human readable code:

load(
  "t=".. .....
  "c=#t
   for i=1,c do
     c=math.max(c,#t[i])
   end
   p=io.write
   p'{'
   for i=1,c do 
     for j=1,c do
       _=j==1 and p'{'
       p(t[i]and t[i][j]or 0)
       p(j==c and'}'or',')
     end
     _=i~=c and p','
   end
   p'}'
  ")
()

Lua, 205 187 bytes

load("t=".. ....."c=#t for i=1,c do c=math.max(c,#t[i])end p=io.write p'{'for i=1,c do for j=1,c do _=j==1 and p'{'p(t[i]and t[i][j]or 0)p(j==c and'}'or',')end _=i~=c and p','end p'}'")()

Try it online!

Human readable code:

load(
  "t=".. .....
  "c=#t
   for i=1,c do
     c=math.max(c,#t[i])
   end
   p=io.write
   p'{'
   for i=1,c do 
     for j=1,c do
       _=j==1 and p'{'
       p(t[i]and t[i][j]or 0)
       p(j==c and'}'or',')
     end
     _=i~=c and p','
   end
   p'}'
  ")
()
squeezed size 205 -> 187 bytes
Source Link
wen1k
  • 53
  • 6

Lua, 205205 187 bytes

load("t="..( ...).."c=#t for i=1,c do c=math.max(c,#t[i])end p=load'iop=io.stdout:write(...)'p' p'{'for i=1,c do for j=1,c do _=j==1 and p'{'p(t[i]and t[i][j]or 0)p(j==c and'}'or',')end _=i~=c and p','end p'}'")()

Try it online!Try it online!

Human readable code:

  
load(
  "t="..( ...)..
  "c=#t
   for i=1,c do
     c=math.max(c,#t[i])
   end
   p=load'iop=io.stdout:write(...)'
   p'{'
   for i=1,c do 
     for j=1,c do
       _=j==1 and p'{'
       p(t[i]and t[i][j]or 0)
       p(j==c and'}'or',')
     end
     _=i~=c and p','
   end
   p'}'
  ")
()

Lua, 205 bytes

load("t="..(...).."c=#t for i=1,c do c=math.max(c,#t[i])end p=load'io.stdout:write(...)'p'{'for i=1,c do for j=1,c do _=j==1 and p'{'p(t[i]and t[i][j]or 0)p(j==c and'}'or',')end _=i~=c and p','end p'}'")()

Try it online!

Human readable code:

 
load(
  "t="..(...)..
  "c=#t
   for i=1,c do
     c=math.max(c,#t[i])
   end
   p=load'io.stdout:write(...)'
   p'{'
   for i=1,c do 
     for j=1,c do
       _=j==1 and p'{'
       p(t[i]and t[i][j]or 0)
       p(j==c and'}'or',')
     end
     _=i~=c and p','
   end
   p'}'
  ")
()

Lua, 205 187 bytes

load("t=".. ....."c=#t for i=1,c do c=math.max(c,#t[i])end p=io.write p'{'for i=1,c do for j=1,c do _=j==1 and p'{'p(t[i]and t[i][j]or 0)p(j==c and'}'or',')end _=i~=c and p','end p'}'")()

Try it online!

Human readable code:

 
load(
  "t=".. .....
  "c=#t
   for i=1,c do
     c=math.max(c,#t[i])
   end
   p=io.write
   p'{'
   for i=1,c do 
     for j=1,c do
       _=j==1 and p'{'
       p(t[i]and t[i][j]or 0)
       p(j==c and'}'or',')
     end
     _=i~=c and p','
   end
   p'}'
  ")
()
improved formatting and added more input data
Source Link
wen1k
  • 53
  • 6

Lua, 205 bytes

load("t="..(...).."c=#t for i=1,c do c=math.max(c,#t[i])end p=load'io.stdout:write(...)'p'{'for i=1,c do for j=1,c do _=j==1 and p'{'p(t[i]and t[i][j]or 0)p(j==c and'}'or',')end _=i~=c and p','end p'}'")()

Try it online!Try it online!

Human readable code:

load(
  "t="..(...)..
  "c=#t
   for i=1,c do
     c=math.max(c,#t[i])
   end
   p=load'io.stdout:write(...)'
   p'{'
   for i=1,c do 
     for j=1,c do
       _=j==1 and p'{'
       p(t[i]and t[i][j]or 0)
       p(j==c and'}'or',')
     end
     _=i~=c and p','
   end
   p'}'
  ")
()

Lua, 205 bytes

load("t="..(...).."c=#t for i=1,c do c=math.max(c,#t[i])end p=load'io.stdout:write(...)'p'{'for i=1,c do for j=1,c do _=j==1 and p'{'p(t[i]and t[i][j]or 0)p(j==c and'}'or',')end _=i~=c and p','end p'}'")()

Try it online!

Human readable code:

load(
  "t="..(...)..
  "c=#t
   for i=1,c do
     c=math.max(c,#t[i])
   end
   p=load'io.stdout:write(...)'
   p'{'
   for i=1,c do 
     for j=1,c do
       _=j==1 and p'{'
       p(t[i]and t[i][j]or 0)
       p(j==c and'}'or',')
     end
     _=i~=c and p','
   end
   p'}'
  ")
()

Lua, 205 bytes

load("t="..(...).."c=#t for i=1,c do c=math.max(c,#t[i])end p=load'io.stdout:write(...)'p'{'for i=1,c do for j=1,c do _=j==1 and p'{'p(t[i]and t[i][j]or 0)p(j==c and'}'or',')end _=i~=c and p','end p'}'")()

Try it online!

Human readable code:

load(
  "t="..(...)..
  "c=#t
   for i=1,c do
     c=math.max(c,#t[i])
   end
   p=load'io.stdout:write(...)'
   p'{'
   for i=1,c do 
     for j=1,c do
       _=j==1 and p'{'
       p(t[i]and t[i][j]or 0)
       p(j==c and'}'or',')
     end
     _=i~=c and p','
   end
   p'}'
  ")
()
Source Link
wen1k
  • 53
  • 6
Loading