# Ethiopian Multiplication # usage: ruby em.rb 673 7 m, n = ARGV.map(&:to_i) product = 0 while m >= 1 puts "%4d : %4d %s" % [m, n, m.even? ? "Ignore" : ""] product += n unless m.even? m = m / 2 n = n * 2 end puts "Product: #{product}"