fib = Enumerator.new do |enum| a, b = 0, 1 loop do enum.yield b a, b = b, a+b end end print fib.take(10)
To embed this project on your website, copy the following code and paste it into your website's HTML: