Skip to content

Instantly share code, notes, and snippets.

@ExReanimator
Created June 25, 2015 20:58
Show Gist options
  • Save ExReanimator/0d6733be7a2cc417866b to your computer and use it in GitHub Desktop.
Save ExReanimator/0d6733be7a2cc417866b to your computer and use it in GitHub Desktop.
My solution for Fibonacci task
fibonacci = -> (i, x = 0, y = x + 1) do
if i > 0
puts x
fibonacci.call(i-1, y, x + y)
end
end
# calculate 10 times
fibonacci.call(10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment