Skip to content

Instantly share code, notes, and snippets.

@phucnguyen81
Last active July 3, 2018 01:58
Show Gist options
  • Select an option

  • Save phucnguyen81/8262961b028feb31049e6d1f80650353 to your computer and use it in GitHub Desktop.

Select an option

Save phucnguyen81/8262961b028feb31049e6d1f80650353 to your computer and use it in GitHub Desktop.

Revisions

  1. phucnguyen81 renamed this gist Jul 3, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. phucnguyen81 created this gist Apr 24, 2017.
    7 changes: 7 additions & 0 deletions fibo.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    def fibonacci_upto(max)
    i1, i2 = 1, 1
    while i1 <= max
    yield i1
    i1, i2 = i2, i1+i2
    end
    end