Skip to content

Instantly share code, notes, and snippets.

@rono23
Created February 6, 2010 05:41
Show Gist options
  • Save rono23/296567 to your computer and use it in GitHub Desktop.
Save rono23/296567 to your computer and use it in GitHub Desktop.
def fibonacci(n)
if n > 2
fibonacci(n - 2) + fibonacci(n - 1)
else
1
end
end
fibonacci(10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment