Skip to content

Instantly share code, notes, and snippets.

@nathankleyn
Created December 30, 2012 12:07
Show Gist options
  • Save nathankleyn/4412539 to your computer and use it in GitHub Desktop.
Save nathankleyn/4412539 to your computer and use it in GitHub Desktop.
Gist #2 For "Functional Programming Techniques With Ruby: Part III"
fact(6) = 6 * fact(5)
= 6 * 5 * fact(4)
= 6 * 5 * 4 * fact(3)
= 6 * 5 * 4 * 3 * fact(2)
= 6 * 5 * 4 * 3 * 2 * fact(1)
= 6 * 5 * 4 * 3 * 2 * 1
= 720
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment