Skip to content

Instantly share code, notes, and snippets.

@shtakai
Created May 9, 2016 19:59
Show Gist options
  • Save shtakai/27af8733bea0643ab528afb1694dc83c to your computer and use it in GitHub Desktop.
Save shtakai/27af8733bea0643ab528afb1694dc83c 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