lib/primes_table.rb
def build_multiplication_table(num_list)
    rows = []
    rows << ['-'] + num_list
    num_list.each do |n|
      rows << [n] + num_list.map{|p| n*p}
    end
    rows
  end
#Returns an array with the rows of a multiplication table based on the +num_list+ list numbers.
Returns an array with the rows of a multiplication table based on the +num_list+ list numbers.
Returns an array with the rows of a multiplication table based on the + num_list + list numbers .
def build_multiplication_table(num_list)
    rows = []
    rows << ['-'] + num_list
    num_list.each do |n|
      rows << [n] + num_list.map{|p| n*p}
    end
    rows
  end
def build_multiplication_table ( num_list ) rows = [ ] rows << [ '-' ] + num_list num_list . each do | n | rows << [ n ] + num_list . map { | p | n * p } end rows end
Returns an array with the rows of a multiplication table based on the +num_list+ list numbers.
Returns an array with the rows of a multiplication table based on the + num_list + list numbers .
num_list