Class: Shufflino::Helpers

Inherits:
Object
  • Object
show all
Defined in:
lib/shufflino/helpers.rb

Class Method Summary collapse

Class Method Details

.factorial(num) ⇒ Object



3
4
5
6
7
# File 'lib/shufflino/helpers.rb', line 3

def self.factorial(num)
  return 1 if num < 1

  num * factorial(num - 1)
end