Kyrylo Silin

Full-stack developer at Airbrake.io. Core team Pry. Passionate about open source, debuggers and food.

“Hello World” with recursive arrays in Ruby

It doesn’t mean anything. Just an interesting observation.

a,@x=[],0;a<<[a,'world']<<'hello';def wtf(i);@x>10?return: (@x+=1;p i[0]; wtf(i[0]));end;wtf(a)

=begin
Output:
[[[...], "hello"], "world"]
[[[...], "world"], "hello"]
[[[...], "hello"], "world"]
[[[...], "world"], "hello"]
[[[...], "hello"], "world"]
[[[...], "world"], "hello"]
[[[...], "hello"], "world"]
[[[...], "world"], "hello"]
[[[...], "hello"], "world"]
[[[...], "world"], "hello"]
[[[...], "hello"], "world"]
=end