James Edward Gray II wrote: > On Jun 26, 2006, at 6:30 PM, Matthew Moss wrote: > >> Wow... If this quiz hasn't set the record for number of entries and >> new quizzers, it's gotta be durned close. > > It's the most popular quiz ever by no small margin! > > James Edward Gray II > > P.S. Can you see me struggling to keep up? ;) > Ok, I wasn't going to send this in, but if it means making the most popular quiz ever even more popular ... My pascal triangle solution aims for single expression hideousness. :-) puts (0...ARGV.first.to_i).inject([[1]]) { |a,x| a.unshift a.first.inject([0,[]]) { |b,y| [y,b.last << (b.first + y)] }.last + [1] }.inject([]) { |c,z| next [z[z.length/2].to_s.length*2,z.length,""] if c.empty? [c[0],c[1], z.map { |j| j.to_s.center(c[0]) }.join('').center(c[0]*c[1])+"\n#{c.last}"] }.last /kel http://web.kellegous.com/