You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
# factorializer!
|
|
|
|
def fact(n)
|
|
if n == 0
|
|
return 1
|
|
else
|
|
return n * fact(n - 1)
|
|
end
|
|
end
|
|
|
|
|
|
def main()
|
|
puts fact(ARGV[0].to_i)
|
|
end
|
|
|
|
|
|
if __FILE__ == $0
|
|
main()
|
|
end
|