Created
January 25, 2013 17:29
-
-
Save tomgullo/4636324 to your computer and use it in GitHub Desktop.
fibonacci test
This file contains 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 fibo(x) { | |
if (x < 2) { | |
return x | |
} else { | |
return fibo(x-1) + fibo(x-2) | |
} | |
} | |
println( (1..10).collect { fibo(it) }.join(",") ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment