From: David Tran Date: 2005-01-11T01:56:32+09:00 Subject: Re: [SOLUTION] Ruby Quiz #14 LCD Numbers ( solution #2 ) 256 bytes. Shrik again from 264 bytes. New idea again. I agree, at this point, this program is not readable at all. If you like a readable version, please check my solution #1 ( maybe it is not readable either :-) ) What I did is I try to make a as small as possible program for the solution. I have fun for this solution is about its size, not the readable / maintenace / performance ... etc. There are many ways to play, I just try to take other way and have fun. (Of couse, if this is my job, I would not solve as it right now :-) ) OK, anyway, like it or not; here is the 256 bytes program. ( Not the gmail wrap line, it is this mailing list wrap my code. So this time, I list the line number as [n], if the program wrapped, join the line together yourself, sometime the line is wrap when a blank character to separate "word", so when join line, you may need add a blank character) [1] s=(s=$*.index"-s")?$*.slice!(s,2)[1].to_i: 2 [2] d,="\21\265\22H\245\10-\0\23".unpack"B*" [3] f=" " [4] o=48 [5] 5.times{|x|((t=x%2==0)?1:s).times{puts $*[0].split('').map{|z|u=d[7*z.to_i,7] [6] t ?u[x/2*3]>o ?f*s+f+f:f+"-"*s+f:(u[h=x*4/3]>o ?f:"|")+f*s+(u[h+1]>o ?f:"|")}*f}} -- David Tran http://www.doublegifts.com