I was looking at Facebook's 'this day in your timeline' thingy when I came across this tweet that I'd retweeted way back in prehistory: https://twitter.com/dbrady/status/12546255974 . It contains a one-liner that prints an ASCII mandelbrot set:
60.times{|a|puts((0..240).map{|b|x=y=i=0;until(x*x+y*y>4||i==99);x,y,i=x*x-y*y+b/120.0-1.5,2*x*y+a/30.0-1,i+1;end;i==99?'#':'.'}*'');}
I wanted to understand it, so the first thing I did was unfold all the blocks, and turn the multiple assignment into three separate lines:
60.times do |a|
puts((0..240).map do |b|
x=y=i=0
until(x*x+y*y>4||i==99)
x = x*x-y*y+b/120.0-1.5