Skip to content

Instantly share code, notes, and snippets.

@ta1kt0me
Last active January 22, 2017 03:33
Show Gist options
  • Select an option

  • Save ta1kt0me/5b58f8f2dcab339c7f36c506930fa42d to your computer and use it in GitHub Desktop.

Select an option

Save ta1kt0me/5b58f8f2dcab339c7f36c506930fa42d to your computer and use it in GitHub Desktop.
fib in ruby
def fib
a, b = 0, 1
Proc.new() {
a, b, c = b, b + a, a
c
}
end
f = fib
10.times {
p f.call
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment