Module: PrimalInstinct::Multificator
- Defined in:
- lib/primal_instinct/multificator.rb
Class Method Summary collapse
Class Method Details
.multification_table(values) ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/primal_instinct/multificator.rb', line 3 def self.multification_table(values) table = [] return table if values.empty? ([1] + values).each do |row| table << ([1] + values.dup).map { |e| e * row } end table[0][0] = nil table end |