Skip to content

Instantly share code, notes, and snippets.

@irmiller22
Created October 16, 2013 03:45
Show Gist options
  • Save irmiller22/7002383 to your computer and use it in GitHub Desktop.
Save irmiller22/7002383 to your computer and use it in GitHub Desktop.
factorial
def factorial(num)
if num <= 1
1
else
num * factorial(num-1)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment