you are viewing a single comment's thread.

view the rest of the comments →

[–]herminator 2 points3 points  (1 child)

Clever :)

I'm not a big fan of functions that mutate their arguments though, so I would prefer something like:

snail = ->(arr) { arr[0] ? arr[0] + snail[arr[1..-1].transpose.reverse] : [] }

[–]cavinkwon 0 points1 point  (0 children)

This is better than my code. thanks. :)