Created
July 15, 2016 03:08
-
-
Save chrisbodhi/53b33aa47e4202d2facd84eb5057d388 to your computer and use it in GitHub Desktop.
"Recursion is the GOTO of functional programming." -- Erik Meijer
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
| def factorial n | |
| (1..n).reduce{ |x, y| x * y } | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment