Code Golf: Seven Segments
Perl, 134 characters All linebreaks may be removed. @s=unpack”C*”,~”P\xdbLI\xc3a`[\@AB\xe0t\xc8df”; $_=<>;for$s(6,3,0){print map$s[hex$&]&1<<$_+$s?$_%2?”_”:”|”:” “, 0..2while/./g;print$/} Explanation @s stores the bits for each segment. The entries are in order from 0 to F (thanks to hex()) and the bits map to segments in this order: 6 7 x 3 4 5 0 1 2 with 0 being the … Read more