Skip to content

Instantly share code, notes, and snippets.

@nyx
Created January 10, 2012 22:34
Show Gist options
  • Save nyx/1591627 to your computer and use it in GitHub Desktop.
Save nyx/1591627 to your computer and use it in GitHub Desktop.
fibonacci sequence with recursion in default argument place (yes I know this is awful)
def fib(a=0, b=1, c=(a > 100 ? exit : (puts a; fib(b, a+b))))
return c
end
fib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment