Created
January 13, 2022 21:22
-
-
Save 0rbianta/9c2886bcc9f0537a67547c1d24e39f42 to your computer and use it in GitHub Desktop.
calc_fibonacci with CoffeeScript
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
calc_fibonacci = (count) -> | |
ptr = 1 | |
last = 1 | |
for _ in [1..count] | |
newv = ptr + last | |
last = ptr | |
ptr = newv | |
ptr | |
console.log calc_fibonacci 2 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment