Skip to content

Instantly share code, notes, and snippets.

@dpick
Created December 25, 2010 00:51
Show Gist options
  • Save dpick/754589 to your computer and use it in GitHub Desktop.
Save dpick/754589 to your computer and use it in GitHub Desktop.
factorial = Hash.new do |h,k|
if k > 1
h[k] = h[k-1] * k
else
h[k] = 1
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment