20 if a list of digits is acceptable -- remove trailing Ḍ
...or if we may print with any leading zeros -- remove trailing Ḍ
and replace the D
with a Ṿ
ZOḅ3/ḅ⁹%129ị“ȯṂṾ;’D¤Ḍ
A monadic Link accepting a list of the three lines which yields an integer.
Try it online!
How?
Magic...
ZOḅ3/ḅ⁹%129ị“ȯṂṾ;’D¤Ḍ - Link: list of lists of characters
Z - transpose
O - to ordinals
3/ - three-wise reduce using:
ḅ - (left list) from base (right) (vectorises)
⁹ - literal 256
ḅ - (left list) from base (256)
129 - literal 129
% - (left) modulo (129) (vectorises)
¤ - nilad followed by link(s) as a nilad:
“ȯṂṾ;’ - base 250 integer = 3792546810
D - to digits = [3,7,9,2,5,4,6,8,1,0]
ị - (left) index into (right) 1-indexed & modular (vectorises)
Huh?...
After ZO
we have a list of columns of 32
s, 95
s, and 124
s where there were spaces, underscores, and pipes, respectively. For example:
_ _
_||_ -> [[32,32,32],[95,95,95],[32,124,124],[32,124,124],[95,95,95],[32,32,124]]
_||_|
The three-wise reduce using base conversion with vectorisation effectively takes each group of three lists (i.e. an input-digit), first converting the left-most to each base defined by the middle list and then converts that resulting list to each base defined by the right-most list:
[32,32,32]ḅ95 = 32×95²+32×95+32 = 291872
->
[32,32,32]ḅ[95,95,95] = [291872,291872,291872]
[291872,291872,291872]ḅ32 = 291872×32²+291872×32+291872 = 308508704
and
[291872,291872,291872]ḅ124 = 291872×124²+291872×124+291872 = 4524307872
->
[291872,291872,291872]ḅ[32,124,124] = [308508704,4524307872,4524307872]
similarly
([32,124,124]ḅ[95,95,95])ḅ[32,32,124] = [317844128,317844128,4661212704]
so applying ZOḅ3/ we have:
_ _
_||_ -> [[308508704,4524307872,4524307872],[317844128,317844128,4661212704]]
_||_|
This gives a unique triples for each input-digit which we convert to unique integers by conversion from base 256 (ḅ⁹
) and modulo by 129 (%129
) to find unique integers which remain unique if modulo-ed by ten.
ZOḅ3/ ḅ⁹ %129 (implicit %10 of ị)
0 [309401120,4628496048,4628496048] 21466435284656 110 0
1 [ 35751968, 524305824, 524305824] 2477787571616 119 9
2 [308605948,4525733964, 308605948] 21383695908860 104 4
3 [308508704,4524307872,4524307872] 21381173548448 41 1
4 [ 47306784, 602657424, 602657424] 3255180354192 6 6
5 [317746884, 317746884,4659786612] 20909862778740 15 5
6 [317844128, 317844128,4661212704] 20916262082080 97 7
7 [299993120,4492051872,4492051872] 20814806443424 92 2
8 [317844128,4661212704,4661212704] 22028164437536 8 8
9 [317746884,4659786612,4659786612] 22021424949108 93 3
(256 was chosen because it is a short literal in Jelly, ḅ14%67
is the same length and also works but the lookup integer, 5987203416
, takes an extra base 250 digit - “¡⁴,>ʠ’
.)
_ _ ZOḅ3/ḅ⁹ %129 (implicit %10 of ị)
_||_ -> [21381173548448,20916262082080] -> [41,97] -> [1,7]
_||_|
and the 1st and seventh elements of “ȯṂṾ;’D = [3,7,9,2,5,4,6,8,1,0]
...are three and six -> [3,6]
1
is narrower than the others. I've checked and I see that in your original source you had 2 leading spaces on the 1, so I'll go ahead and edit these back in. You also haven't specified the output for 0 so I will edit that in also. Feel free to roll back my edits if you disagree. \$\endgroup\$