Skip to main content
minor update
Source Link
Arnauld
  • 197.8k
  • 20
  • 180
  • 650

Each of the 13 rowsThe leading sequence is 0000 and is omitted. The other sequences are stored as:

1e6 + '1023405671567899AB99A899CB99C'

which expands to:

0      1    2    3    4    5    6    7    8    9
(0000) 1000 0001 0234 0567 1567 899A B99A 899C B99C

Each matrix row is made of threea 'background' characterscharacter appearing 3 times and a single 'foreground' character appearing only once (or not at all). So theythe rows can be encoded as:

 ID | string | digits | FG position | BG char. | FG char.
----+--------+--------+-------------+----------+----------
  0 | "    " |  1111  |      4      |    1     |    0
  1 | "___ " |  0001  |      0      |    0     |    1
  2 | "\   " |  2111  |      3      |    1     |    2
  3 | " \  " |  1211  |      2      |    1     |    2
  4 | "  \ " |  1121  |      1      |    1     |    2
  5 | "  / " |  1131  |      1      |    1     |    3
  6 | " /  " |  1311  |      2      |    1     |    3
  7 | "/   " |  3111  |      3      |    1     |    3
  8 | "   ." |  1114  |      0      |    1     |    4
  9 | "   |" |  1116  |      0      |    1     |    6
  A | "   '" |  1115  |      0      |    1     |    5
  B | "___." |  0004  |      0      |    0     |    4
  C | "___'" |  0005  |      0      |    0     |    5
----+--------+--------+-------------+----------+----------
                             |           |          |
                             |           |          +--> stored as "0122233346545"
                             |           +-------------> stored as the bit mask 2045
                             +-------------------------> stored as "40321123"

Each of the 13 rows are made of three 'background' characters and a single 'foreground' character. So they can be encoded as:

 ID | string | digits | FG position | BG char. | FG char.
----+--------+--------+-------------+----------+----------
  0 | "    " |  1111  |      4      |    1     |    0
  1 | "___ " |  0001  |      0      |    0     |    1
  2 | "\   " |  2111  |      3      |    1     |    2
  3 | " \  " |  1211  |      2      |    1     |    2
  4 | "  \ " |  1121  |      1      |    1     |    2
  5 | "  / " |  1131  |      1      |    1     |    3
  6 | " /  " |  1311  |      2      |    1     |    3
  7 | "/   " |  3111  |      3      |    1     |    3
  8 | "   ." |  1114  |      0      |    1     |    4
  9 | "   |" |  1116  |      0      |    1     |    6
  A | "   '" |  1115  |      0      |    1     |    5
  B | "___." |  0004  |      0      |    0     |    4
  C | "___'" |  0005  |      0      |    0     |    5

The leading sequence is 0000 and is omitted. The other sequences are stored as:

1e6 + '1023405671567899AB99A899CB99C'

which expands to:

0      1    2    3    4    5    6    7    8    9
(0000) 1000 0001 0234 0567 1567 899A B99A 899C B99C

Each matrix row is made of a 'background' character appearing 3 times and a 'foreground' character appearing only once (or not at all). So the rows can be encoded as:

 ID | string | digits | FG position | BG char. | FG char.
----+--------+--------+-------------+----------+----------
  0 | "    " |  1111  |      4      |    1     |    0
  1 | "___ " |  0001  |      0      |    0     |    1
  2 | "\   " |  2111  |      3      |    1     |    2
  3 | " \  " |  1211  |      2      |    1     |    2
  4 | "  \ " |  1121  |      1      |    1     |    2
  5 | "  / " |  1131  |      1      |    1     |    3
  6 | " /  " |  1311  |      2      |    1     |    3
  7 | "/   " |  3111  |      3      |    1     |    3
  8 | "   ." |  1114  |      0      |    1     |    4
  9 | "   |" |  1116  |      0      |    1     |    6
  A | "   '" |  1115  |      0      |    1     |    5
  B | "___." |  0004  |      0      |    0     |    4
  C | "___'" |  0005  |      0      |    0     |    5
----+--------+--------+-------------+----------+----------
                             |           |          |
                             |           |          +--> stored as "0122233346545"
                             |           +-------------> stored as the bit mask 2045
                             +-------------------------> stored as "40321123"
fixed according to the spec update
Source Link
Arnauld
  • 197.8k
  • 20
  • 180
  • 650

JavaScript (Node.js), 257265 bytes

f=n=>n?`012388887654``01238888765${n<1e4?4:48888}`.replace(e=/\d/g,y=>`7654|0123y=>`4567|3210
`.replace(e,x=>"_ \\/.'|"[q=y/2&2|x>3,y&8?1:(k=8-~~'80764467'[j=~~k='40321123'[j=~~('0x'+(1e6+'1023405671567899AB99A899CB99C')[y%4+~-(n/10**q%10)*4])]>>x%4&1]^x%4?'0122233346545'[j]:2045>>j&1:'0122233346545'[j])^0xCC6600>>k*4+q&1]))+f(n/1e4|0):''

Try it online!Try it online!

Each of the 13 rows are made of athree 'background' charactercharacters and a single 'foreground' character. So they can be encoded as:

  • athe position of the 'foreground' character (0 for rightmost to 3 for leftmost, or 4-bit mask if none)
  • the 'background' character (which is always either 0 for "_" or 1 for " ")
  • the 'foreground' character
 ID | string | digits | maskFG position | BG char. | FG char.
----+--------+--------+-------------+----------+----------
  0 | "    " |  1111  | 0000     4      |    1     |    0
  1 | "___ " |  0001  | 0001     0      |    0     |    1
  2 | "\   " |  2111  | 1000     3      |    1     |    2
  3 | " \  " |  1211  | 0100     2      |    1     |    2
  4 | "  \ " |  1121  | 0010     1      |    1     |    2
  5 | "  / " |  1131  | 0010     1      |    1     |    3
  6 | " /  " |  1311  | 0100     2      |    1     |    3
  7 | "/   " |  3111  | 1000     3      |    1     |    3
  8 | "   ." |  1114  | 0001     0      |    1     |    4
  9 | "   |" |  1116  | 0001     0      |    1     |    6
  A | "   '" |  1115  | 0001     0      |    1     |    5
  B | "___." |  0004  | 0001     0      |    0     |    4
  C | "___'" |  0005  | 0001     0      |    0     |    5

JavaScript (Node.js), 257 bytes

f=n=>n?`012388887654`.replace(e=/\d/g,y=>`7654|0123
`.replace(e,x=>"_ \\/.'|"[q=y/2&2|x>3,y&8?1:(k=8-~~'80764467'[j=~~('0x'+(1e6+'1023405671567899AB99A899CB99C')[y%4+~-(n/10**q%10)*4])]>>x%4&1?'0122233346545'[j]:2045>>j&1)^0xCC6600>>k*4+q&1]))+f(n/1e4|0):''

Try it online!

Each of the 13 rows are made of a 'background' character and a 'foreground' character. So they can be encoded as:

  • a 4-bit mask
  • the 'background' character (which is always either 0 for "_" or 1 for " ")
  • the 'foreground' character
 ID | string | digits | mask | BG char. | FG char.
----+--------+--------+------+----------+----------
  0 | "    " |  1111  | 0000 |    1     |    0
  1 | "___ " |  0001  | 0001 |    0     |    1
  2 | "\   " |  2111  | 1000 |    1     |    2
  3 | " \  " |  1211  | 0100 |    1     |    2
  4 | "  \ " |  1121  | 0010 |    1     |    2
  5 | "  / " |  1131  | 0010 |    1     |    3
  6 | " /  " |  1311  | 0100 |    1     |    3
  7 | "/   " |  3111  | 1000 |    1     |    3
  8 | "   ." |  1114  | 0001 |    1     |    4
  9 | "   |" |  1116  | 0001 |    1     |    6
  A | "   '" |  1115  | 0001 |    1     |    5
  B | "___." |  0004  | 0001 |    0     |    4
  C | "___'" |  0005  | 0001 |    0     |    5

JavaScript (Node.js), 265 bytes

f=n=>n?`01238888765${n<1e4?4:48888}`.replace(e=/\d/g,y=>`4567|3210
`.replace(e,x=>"_ \\/.'|"[q=y/2&2|x>3,y&8?1:(k='40321123'[j=~~('0x'+(1e6+'1023405671567899AB99A899CB99C')[y%4+~-(n/10**q%10)*4])]^x%4?2045>>j&1:'0122233346545'[j])^0xCC6600>>k*4+q&1]))+f(n/1e4|0):''

Try it online!

Each of the 13 rows are made of three 'background' characters and a single 'foreground' character. So they can be encoded as:

  • the position of the 'foreground' character (0 for rightmost to 3 for leftmost, or 4 if none)
  • the 'background' character (which is always either 0 for "_" or 1 for " ")
  • the 'foreground' character
 ID | string | digits | FG position | BG char. | FG char.
----+--------+--------+-------------+----------+----------
  0 | "    " |  1111  |      4      |    1     |    0
  1 | "___ " |  0001  |      0      |    0     |    1
  2 | "\   " |  2111  |      3      |    1     |    2
  3 | " \  " |  1211  |      2      |    1     |    2
  4 | "  \ " |  1121  |      1      |    1     |    2
  5 | "  / " |  1131  |      1      |    1     |    3
  6 | " /  " |  1311  |      2      |    1     |    3
  7 | "/   " |  3111  |      3      |    1     |    3
  8 | "   ." |  1114  |      0      |    1     |    4
  9 | "   |" |  1116  |      0      |    1     |    6
  A | "   '" |  1115  |      0      |    1     |    5
  B | "___." |  0004  |      0      |    0     |    4
  C | "___'" |  0005  |      0      |    0     |    5
added the description of the row encoding
Source Link
Arnauld
  • 197.8k
  • 20
  • 180
  • 650

Each of the 13 rows are made of a 'background' character and a 'foreground' character. So they can be encoded as:

  • a 4-bit mask
  • the 'background' character (which is always either 0 for "_" or 1 for " ")
  • the 'foreground' character

This is summarized in the following table:

 ID | string | digits | mask | BG char. | FG char.
----+--------+--------+------+----------+----------
  0 | "    " |  1111  | 0000 |    1     |    0
  1 | "___ " |  0001  | 0001 |    0     |    1
  2 | "\   " |  2111  | 1000 |    1     |    2
  3 | " \  " |  1211  | 0100 |    1     |    2
  4 | "  \ " |  1121  | 0010 |    1     |    2
  5 | "  / " |  1131  | 0010 |    1     |    3
  6 | " /  " |  1311  | 0100 |    1     |    3
  7 | "/   " |  3111  | 1000 |    1     |    3
  8 | "   ." |  1114  | 0001 |    1     |    4
  9 | "   |" |  1116  | 0001 |    1     |    6
  A | "   '" |  1115  | 0001 |    1     |    5
  B | "___." |  0004  | 0001 |    0     |    4
  C | "___'" |  0005  | 0001 |    0     |    5

Each of the 13 rows are made of a 'background' character and a 'foreground' character. So they can be encoded as:

  • a 4-bit mask
  • the 'background' character (which is always either 0 for "_" or 1 for " ")
  • the 'foreground' character

This is summarized in the following table:

 ID | string | digits | mask | BG char. | FG char.
----+--------+--------+------+----------+----------
  0 | "    " |  1111  | 0000 |    1     |    0
  1 | "___ " |  0001  | 0001 |    0     |    1
  2 | "\   " |  2111  | 1000 |    1     |    2
  3 | " \  " |  1211  | 0100 |    1     |    2
  4 | "  \ " |  1121  | 0010 |    1     |    2
  5 | "  / " |  1131  | 0010 |    1     |    3
  6 | " /  " |  1311  | 0100 |    1     |    3
  7 | "/   " |  3111  | 1000 |    1     |    3
  8 | "   ." |  1114  | 0001 |    1     |    4
  9 | "   |" |  1116  | 0001 |    1     |    6
  A | "   '" |  1115  | 0001 |    1     |    5
  B | "___." |  0004  | 0001 |    0     |    4
  C | "___'" |  0005  | 0001 |    0     |    5
added a description of the encoding
Source Link
Arnauld
  • 197.8k
  • 20
  • 180
  • 650
Loading
updated according to the new spec
Source Link
Arnauld
  • 197.8k
  • 20
  • 180
  • 650
Loading
saved 3 bytes
Source Link
Arnauld
  • 197.8k
  • 20
  • 180
  • 650
Loading
saved 2 bytes
Source Link
Arnauld
  • 197.8k
  • 20
  • 180
  • 650
Loading
saved 2 bytes
Source Link
Arnauld
  • 197.8k
  • 20
  • 180
  • 650
Loading
Source Link
Arnauld
  • 197.8k
  • 20
  • 180
  • 650
Loading