Skip to content

Instantly share code, notes, and snippets.

@minodisk
Last active August 29, 2015 13:59
Show Gist options
  • Select an option

  • Save minodisk/10464634 to your computer and use it in GitHub Desktop.

Select an option

Save minodisk/10464634 to your computer and use it in GitHub Desktop.
fibonacci
cache = [ 0, 1 ]
fibonacci = (n) ->
return cache[n] if cache[n]?
cache[n] = fibonacci(n - 1) + fibonacci(n - 2)
for i in [0..10]
console.log i, fibonacci i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment