Multiplication Table In AoH Structure

Posted by root Sun, 03 Aug 2008 18:09:00 GMT

mt = Array.new(10) { |e| Hash.new { |h,k| h[k] = k * e } }

mt[1][2] => 2
mt[2][2] => 4
mt[5][4] => 20
mt[9][5] => 45

Posted in  | Tags ,  | no comments | no trackbacks