Tim Hunter wrote: > Werner wrote: >> Is there anyone who could enlighten me? >> >> Thanks and Best Regards >> >> Werner Dahn >> > > # Man or boy test > def a(k, x1, x2, x3, x4, x5) > b ||= Proc.new { k -= 1; a(k, b, x1, x2, x3, x4) } > return k <= 0 ? x4[] + x5[] : b[] > end > > puts a(10, Proc.new {1}, Proc.new {-1}, Proc.new {-1}, Proc.new {1}, > Proc.new {0}) Nice post, Tim. I tested it and, when it gave the correct answer, I decided to share it with the world. http://en.wikipedia.org/wiki/Man_or_boy_test -- Posted via http://www.ruby-forum.com/.