Skip to main content
added 19 characters in body
Source Link
Razetime
  • 27.6k
  • 3
  • 31
  • 77

K (ngn/k), 9796 bytes

` 0:4_'{r:o@x,(y@1)y[1]," ";(,x,(*y),"-- ",*z),/$[z@1;("+|"r/:-1_z@1),"L "r/:-1#z@1;""]}["";" ";]@ 

Try it online!Try it online!

Quite a shame that this took so long, but I'm glad that I stuck with the problem.

Recursive function which prints each line of the tree separately. ngn/k's json parser is used to get the array.

-6 bytes from coltim.

-1 from ngn.

K (ngn/k), 97 bytes

` 0:4_'{r:o@x,(y@1)," ";(,x,(*y),"-- ",*z),/$[z@1;("+|"r/:-1_z@1),"L "r/:-1#z@1;""]}["";" ";]@ 

Try it online!

Quite a shame that this took so long, but I'm glad that I stuck with the problem.

Recursive function which prints each line of the tree separately. ngn/k's json parser is used to get the array.

-6 bytes from coltim.

K (ngn/k), 96 bytes

` 0:4_'{r:o@x,y[1]," ";(,x,(*y),"-- ",*z),/$[z@1;("+|"r/:-1_z@1),"L "r/:-1#z@1;""]}["";" ";]@ 

Try it online!

Quite a shame that this took so long, but I'm glad that I stuck with the problem.

Recursive function which prints each line of the tree separately. ngn/k's json parser is used to get the array.

-6 bytes from coltim.

-1 from ngn.

added 12 characters in body
Source Link
Razetime
  • 27.6k
  • 3
  • 31
  • 77

K (ngn/k), 10397 bytes

{` 0:'4_'4_'{r:o@x,(y@1)," ";(,x,(*y),"-- ",*z),,/$[z@1;(r["+|"]'"+|"r/:-1_z@1),r["L"L "]'"r/:-1#z@1;""]}["";" ";x]}";]@ 

Try it online!Try it online!

Quite a shame that this took so long, but I'm glad that I stuck with the problem.

Recursive function which prints each line of the tree separately. ngn/k's json parser is used to get the array.

-6 bytes from coltim.

K (ngn/k), 103 bytes

{` 0:'4_'{r:o@x,(y@1)," ";(,x,(*y),"-- ",*z),,/$[z@1;(r["+|"]'-1_z@1),r["L "]'-1#z@1;""]}["";" ";x]} 

Try it online!

Quite a shame that this took so long, but I'm glad that I stuck with the problem.

Recursive function which prints each line of the tree separately. ngn/k's json parser is used to get the array.

K (ngn/k), 97 bytes

` 0:4_'{r:o@x,(y@1)," ";(,x,(*y),"-- ",*z),/$[z@1;("+|"r/:-1_z@1),"L "r/:-1#z@1;""]}["";" ";]@ 

Try it online!

Quite a shame that this took so long, but I'm glad that I stuck with the problem.

Recursive function which prints each line of the tree separately. ngn/k's json parser is used to get the array.

-6 bytes from coltim.

Source Link
Razetime
  • 27.6k
  • 3
  • 31
  • 77

K (ngn/k), 103 bytes

{` 0:'4_'{r:o@x,(y@1)," ";(,x,(*y),"-- ",*z),,/$[z@1;(r["+|"]'-1_z@1),r["L "]'-1#z@1;""]}["";" ";x]} 

Try it online!

Quite a shame that this took so long, but I'm glad that I stuck with the problem.

Recursive function which prints each line of the tree separately. ngn/k's json parser is used to get the array.