Sha256: 9d4b21c2b5eb2a215599be266790c041b715869aafeca5d8e413e8a44ed8e9d0

Contents?: true

Size: 138 Bytes

Versions: 8

Compression:

Stored size: 138 Bytes

Contents

def factorial(n)
  if n > 0
    return n * factorial(n-1)
  else
    return 1
  end
end
n = ARGV[0] || 5
puts "#{n}! is #{factorial(5)}"

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
trepanning-2.15.35 test/example/factorial.rb
trepanning-1.93.35 test/example/factorial.rb
trepanning-2.15.33 test/example/factorial.rb
trepanning-1.93.32 test/example/factorial.rb
rbx-trepanning-0.2.1-universal-rubinius-2.0 test/example/factorial.rb
rbx-trepanning-0.2.1-universal-rubinius-1.2 test/example/factorial.rb
rbx-trepanning-0.2.0-universal-rubinius-2.0 test/example/factorial.rb
trepanning-0.1.6 test/example/factorial.rb