Skip to content

Instantly share code, notes, and snippets.

@jacek213
Created February 11, 2014 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacek213/8933994 to your computer and use it in GitHub Desktop.
Save jacek213/8933994 to your computer and use it in GitHub Desktop.
nth fibbonachi number
def fib n
a, b = 0, 1
n.times do
a, b = b, a + b
end
a
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment