Created
February 6, 2010 05:41
-
-
Save rono23/296568 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def fibonacci(num, current, prev, fibo=[]) | |
| return fibo if num < 1 | |
| fibo << current | |
| fibonacci(num - 1, current + prev, current, fibo) | |
| end | |
| fibonacci(10, 1, 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment