From: email55555 email55555 Date: 2005-01-10T05:13:28+09:00 Subject: [SOLUTION] Ruby Quiz #14 LCD Numbers ( solution #2 ) Wow ... Jannis Harder's solution is really short .... This is base on Jannis Harder's solution (398 bytes) ... We could make Jannis Harder's solution even shorter, for example: (1) y.map!{|v|v<<32} could rewrite to y.map!{|v|v< save 1 byte (2) many ?: code like ?x: y could rewrite to ?x:y ( no need space before y) ==> save n bytes (3) and ... (see my code about my idea to make it even shorter ) Here is my even shorter solution ( base on Jannis Harder's solution ) it is 349 bytes ( 49 bytes shorter than Jannis Harder's solution ) 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{""} i.each{|z|u=d[z*7,7] 3.times{|x|y[x*2]<<(u[x*3]