Skip to content

Instantly share code, notes, and snippets.

@eveadele
Created April 17, 2014 19:03
Show Gist options
  • Save eveadele/11005071 to your computer and use it in GitHub Desktop.
Save eveadele/11005071 to your computer and use it in GitHub Desktop.
Factorial
def factorial(n)
if n == 1
1
else
n * factorial(n - 1)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment