MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/ghmkir/deleted_by_user/fqyamsc/?context=3
r/badcode • u/[deleted]
[deleted] — view deleted post
44 comments sorted by
View all comments
Show parent comment
3
:) My main goal was that the '0123456789' 7-segment 'font' was visible as-is in the code.
Ofcourse, it could've been worse:
function to_ascii_seven_segment( ... $numbers) { $g=fn($d)=>is_numeric($d)?hexdec(substr('00f59079d99ccded91fddd',$d+1<<1,2))<<1:0;$q=' |_'; $j=fn($c,$v,$s="\n")=>join($s,array_map($c,$v)); return @$j(fn($n)=>$j(fn($r)=>$j(fn($d)=> $q[0<($g($d)&1<<$r++)].$q[(0<($g($d)&1<<$r++))<<1].$q[0<($g($d)&1<<$r++)], str_split($n),''),range(0,9,3)),$numbers); }
https://3v4l.org/899oJ
View all comments
Show parent comment
3
u/joske79 May 17 '20 edited May 17 '20
:) My main goal was that the '0123456789' 7-segment 'font' was visible as-is in the code.
Ofcourse, it could've been worse:
https://3v4l.org/899oJ