fibUpTo(1000) {|term| print term, " "} produces: 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987
Example 6: Using the fibUpTo iterator.
Back to Article