Skip to content

Instantly share code, notes, and snippets.

@shtakai
Created May 9, 2016 19:59
Show Gist options
  • Save shtakai/9efed4dfabd81dd8199c705e8bc02480 to your computer and use it in GitHub Desktop.
Save shtakai/9efed4dfabd81dd8199c705e8bc02480 to your computer and use it in GitHub Desktop.
require 'pp'
def recursive(n)
n == 1 ? 1 : n*recursive(n-1)
end
pp recursive(7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment