From: Michael Kohl Date: 2009-06-08T06:36:15+09:00 Subject: Re: adding, multiplying array On Sun, Jun 7, 2009 at 10:55 PM, Rha7 wrote: > require 'pp' > d=[] > a.each_with_index{|o, i| d[i] = a[i] + b[i] * c[i] }; > pp d Since you don't use the 'o' block variable, you can also use Array#each_index (which is what I used in my first reply to this thread). c.each_index { |i| c[i] += a[i] * b[i] } -- Blog: http://citizen428.net/ Twitter: http://twitter.com/citizen428