There was an error while loading. Please reload this page.
1 parent cf0c2f0 commit 183b02dCopy full SHA for 183b02d
0 Basics/fibUpTo.rb
@@ -0,0 +1,9 @@
1
+def fibUpTo(max)
2
+ i1, i2 = 1, 1
3
+ while i1 <= max
4
+ yield i1
5
+ i1, i2 = i2, i1+i2
6
+ end
7
+end
8
+
9
+fibUpTo(1000) { |f| print f, " " }
0 commit comments