From: Harold Hausman Date: 2006-08-11T18:36:40+09:00 Subject: Re: Codegolf - Pascals Triangle On 8/11/06, Kev Jackson wrote: > > On 11 Aug 2006, at 15:58, benjohn@fysh.org wrote: > > >> My take on the latest problem from http://www.codegolf.com > >> > >> a=[] > >> 34.times{k=0;puts (a.map!{|i|k+k=i}<<1).join(" ")} > > > > :) That's very impressive - I like the way you've implemented the > > filter > > like box kernel (summing adjacent array entries) - I wouldn't have > > imagined the k=i would bind tighter than the k+k. > > how about > > a=[] > 34.times{k=0;p (a.map!{|i|k+k=i}<<1).join(" ")} > > I *never* use puts, and in this case using p saves you 3 characters - > yay for micro-tuning :) > > Kev > Unfortunately, the p method puts things in "" on stdout, which would cause your code to fail the acceptance test. :( -Harold