Skip to content

Instantly share code, notes, and snippets.

@nathankleyn
Created December 30, 2012 12:06
Show Gist options
  • Save nathankleyn/4412536 to your computer and use it in GitHub Desktop.
Save nathankleyn/4412536 to your computer and use it in GitHub Desktop.
Gist #1 For "Functional Programming Techniques With Ruby: Part III"
def fact(n)
return 1 if (0..1).include?(n)
n * fact(n - 1)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment