From: Patrick Doyle Date: 2008-09-11T01:43:09+09:00 Subject: Re: How to operate on 2 arrays simultaneously? > a = 0,1,2 > b = 3,4,5 > > c = a.zip(b).map{|pair| pair.first + pair.last} Arrghh! I looked at zip and, for some reason completely missed the fact that it constructs an array of arrays. For some reason, I decided that it simply interweaved the two arrays. That's what I was looking for. > c = Array.new(a.size){|i| a[i] + b[i]} > the second is far more efficient for large arrays - in terms of memory. ok, I can see that. Thanks for the tips. --wpd