From: Rick DeNatale Date: 2007-04-09T21:18:16+09:00 Subject: Re: Getting to 100 (#119) On 4/8/07, Marcel Ward wrote: > On 08/04/07, Carl Porth wrote: > > After going back and reading the current solutions, I like Ken Bloom's > > each_partition method. It's much cleaner than my combinations method. > > I agree, very clean and efficient. The three lines that put it all > together using #zip are what makes this work for me: > > Digits.each_partition(Operators.length+1) do |digitspart| > OperatorPerms.each do |operatorsperm| > expression=digitspart.zip(operatorsperm).flatten.join > ... > > I think I would be feeling very happy if I'd submitted this solution :) May I have the temerity to point out that I posted basically the same solution, which I posted two hours before Ken's. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/