Skip to content

Instantly share code, notes, and snippets.

@tulios
Created October 11, 2011 16:19
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 tulios/1278559 to your computer and use it in GitHub Desktop.
Save tulios/1278559 to your computer and use it in GitHub Desktop.
fibonacci
def fibonacci number
number <= 1 ? number : (fibonacci(number - 1) + fibonacci(number - 2))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment