From: Florian Gross Date: 2005-01-10T06:11:22+09:00 Subject: Re: [SOLUTION] Ruby Quiz #14 LCD Numbers ( solution #2 ) email55555 email55555 wrote: > Thanks Jannis Harder found the bug. > It is still 349 bytes program: > ( the bug is on "u[x==1?2:5]<0", it should be "u[x==1?2:5] error "o" instead of "0") > > s=$*.index("-s");s=(s ?$*.slice!(s,2)[1].to_i: 2) Why the spaces? Why the parentheses? s=$*.index "-s";s=s?$*.slice!(s,2)[1].to_i:2 > i=$*.join.split("").map{|x|x.to_i} > d,="7krtt1r30v/s".unpack("m")[0].unpack("B*") > f=" " > a,b=f*s,f+"-"*s+f > c,e,o="|",a+f+f,49 > y=([0]*5).map{""} y=(1..5).map{""} > i.each{|z|u=d[z*7,7] i.map > 3.times{|x|y[x*2]<<(u[x*3] [1,3].each{|x|y[x]<<(u[x==1?1:4]