Created
May 14, 2012 10:15
-
-
Save fanweixiao/2693106 to your computer and use it in GitHub Desktop.
tail recursion fibonacci in coffee
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
fib = (n)-> | |
return ((n,a,b) -> | |
if n>0 then arguments.callee n-1, b, a+b else a | |
)(n,0,1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment