in reply to (Golf) LED Sign
(Using hex conversion for the string (and to delete unwanted characters! ) and an array slice of an array slice to generate the lines.)sub led{ ($b=pop)=~y/0-9.\-\0-~/\0-\cK/d; join$/, map{join$", ($"x4,'X ',' X','X X','X'x4)[(/./g)[unpack'C*',$b]] }424434444400, (322231123300)x2, 324444424404, (321222323200)x2, (424x4)-4,"" } print led @ARGV ? shift : "19QQ86\t-- \@0134.72x-0(?)";
  p($b=pop)=~y/-0-9./\0-\cK/;join$/, map{join$",('X ',$"x4,' X','X X','X'x4)[(/./g)[unpack'C*',$b]]} 142443444441,(132223002331)x2,432444442441,(132022232321)x2,1 .424x4 ,""
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: (Golf) LED Sign
by tadman (Prior) on Jun 11, 2001 at 05:02 UTC |