From: Robert Dober Date: 2006-10-17T18:58:04+09:00 Subject: Re: Array.new question ------=_Part_131745_8497512.1161079081506 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 10/17/06, Peter Szinek wrote: > > Alex, > > > Right... In that case, how about this: > > > > input.each{|i| i.each_with_index{|x,j| (result[j] ||= []) << x}} > > > > Not sure if it'll play the way you want with variable-length arrays, but > > it puts the right contents in result. > > Thx for the solution! Mine was totally the same (for the first time in > history since I am using Ruby :-) as someone proposed on this list ;-) You are simply brilliant ;) Peter > http://www.rubyrailways.com > > > > > > -- The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. - George Bernhard Shaw ------=_Part_131745_8497512.1161079081506--