# R.E.P.A.I.R. T.H.E. K.E.Y.B.O.A.R.D

Sequel of this AWESOME challenge

You, a genius tech prodigy detective, have successfully disarmed the bomb and want to break into the computer. The police found the password 67890-=yuiop[]hjkl;'\vbnm^&*()_+:"| on a piece of paper, but much of the keyboard is broken and there are no other ways of inputting characters.

# Step 1: Functions or programs.

We need to have functions, so we have to take =, from which we can make x=>[code] or similar.

So, what can we do with what we've got?

67890 can be made with numeric operations. But for the rest, we need string coercion, which we can't get without some other character.

# What if I didn't need functions? (Note - below this is all hypothetical).

We still need some form of string coercion:

• String.fromCharCode
• +[] or +''
• Literally calling toString

The first requires in.omh, so is obviously not an option.

The second requires + and either ',", a backtick or [] - Sorry, but no.

The third has the same problems as the first.

So that's all we can do, and it's not enough.

# But what about 2 characters?

Sadly, +' and +" have no way of getting specific characters. + adds function calling to our repetoire, but charAt needs an h and a . .

If we start with a string(using backticks because function calling), we can get one character of our choice! But we can't get anything else, so that's a dead end.

Enter escape sequences!

With ' and \, we can do things like "\153" or "\x2c", netting us a bunch of extra characters! The complete list is:

-: '\55'
i: '\151'
[: '\133'
]: '\135'
j: '\152'
k: '\153'
l: '\154'
b: '\142'
m: '\155'
*: '\52'
): '\51'
+: '\53'
": '\42'
=: '\x3d'
]: '\x5d'
^: '\x5e'
_: '\x5f'
:: '\x3a'
Along with the standard:
': '\''
\: '\\'

This leaves yuoph;n&(| to deal with.

Checking which character will be the most effective out of 67890b, we get 7, adding 5 characters to our list

y: '\171'
u: '\x75'
o: '\157'
;: '\73'
|: '\174'

And now we're down to phn&(. Checking again, we find 0 gives us ph(:

p: '\x70'
h: '\150'
(: '\50'

Leaving us n&. Finally, 6 unlocks the last two:

n: '\156'
&: '\46'

So our extra charset is '\670. Note that here we have assembled the full octal set: 01234567, and can make any character with what we've defined. But what else can we do?

# What if we try something different?

What if we use +[] to start with? +[] is the basis of most of javascript, and we can now use some previously useless characters. We still have no function calling, but:

We can get . by taking the second character of 11e111 which is coerced into 1.1e112: [11e111+[]][+[]][1]

From there, we can get -, by making .0000001 as a string, coercing into a float, which is 1e-7, then coerce back to a string and get the right character : [+[[11e111+[]][+[]][1]+1%1+1%1+1%1+1%1+1%1+1%1+1][+[]]+[]][+[]][2]

We can get the string "undefined" from taking the first of an empty array: [][+[]]+[], "true" and "false" from !![]+[] and ![]+[], "NaN" from coercing undefined to a number: +[][+[]], and "[object Object]" from CSS+[]. Adding this, our character pool (as strings only) is now:

"-.undefitrualsNa[objcO]"

We can take []['f'+'i'+'n'+'d']+[] to get the code of the find function as a string:

function find() {
[native code]
}

Our string character pool is now -.undefitrualsNa[objcO] (){vc} and newline.

Note that from this we can get "constructor". We can use this like so: []["constructor"]+[] returns function Array() { \n[native code]\n}, adding A and y to our pool. [[]+[]][+[]]["constructor"]+[] returns the string function, giving us S and g. []["find"]["constructor"]+[] adds F from Function.

So, our current string is -.undefitrualsNa[objcO] (){vc}AySgF, from which we can take snippets for -yuio[]jlvbn() by taking arbitrary characters, leaving us with =phk\m^&*_+:"| to deal with. Note that while + is in our codebase, it cannot be coerced into a string with only what we have.

# Now what?

For the remaining characters, one option is to add (), reducing it to JSFuck.

Another option is to add backtick and =, reducing it to Turing complete javascript

With the new Pipeline operator, all you need is | (we already have >), but does this count as valid?

We can also try the afromentioned escape sequences.

## In conclusion, restricted-source in Javascript is very difficult.

• Since code-golf is also a criterion, you should replace 15%15 with 1%1. Apr 14, 2021 at 9:43
• @xigoi Ok, forgot about that. Apr 14, 2021 at 9:44

# Labyrinth, score 35, 180 bytes

6 54.@
7 55.@
8 312.@
9 313.@
0 !@
- 45.@
= 1341.@
y 121.@
u 1141.@
i 2153.@
o 111.@
p 112.@
[ 1115.@
] 2141.@
h 2152.@
j 2154.@
k 1131.@
l 1132.@
; 315.@
' 551.@
\ 4444.@
v 4214.@
b 354.@
n 1134.@
m 1133.@
^ 2142.@
& 2342.@
* 42.@
( 552.@
) 41.@
_ 351.@
+ 43.@
: 314.@
" 34.@
| 124.@

Try the comprehensive test online!

Uses . (character output command) from the fairy.

## Explanation

A Labyrinth program is normally laid out on a 2D grid, but here each program is supposed to be a no-input single-char-output program, so they're best golfed as linear programs.

Now, except for !@ which outputs 0, every program constructs a single number, outputs it as a char, and halts.

### Secret 1

0-9 commands in Labyrinth are not number literals. Instead, a digit command adds itself to the end of the top number on the stack (alternatively, multiply 10 and add the digit to the top). Since the top is implicitly zero at the start of the program, a sequence of digit commands constructs that exact multi-digit number.

### Secret 2

The real magic comes with the . command, which prints the top number modulo 256 as char. So 312. gives 8 (ascii 56) because 312 % 256 == 56. It turns out that all charcodes can be converted to an equivalent number modulo 256 that has only 1-5 in its digits.

The answer in Hexagony, initially written in the similar vein, has been moved to another answer of its own.

# Sleep, all 35 chars, 5292 bytes

6 zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz z zzz zzz zzz z zzz zzz zzz zzz zz zz zz zz zzzz zzzzzzzz z zzz zzzzz z zzzzz zz zzz zzz zzz zzz zzzzz z zzz zzz zzz zzz zzz zzz zzzzz zzz zzz zzzzz z zzz zzz zzz zzz zzzzz z zzz zzz zzz zzz zzz zzz zzzzz zz zzz zzzzz
7 zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz z zzz zzz zzz z zzz zzz zzz zzz zz zz zz zz zzzz zzzzzzzz z zzz zzzzz z zzzzz zz zzz zzz zzz zzz zzzzz z zzz zzz zzz zzz zzz zzz zzzzz zzz zzz zzzzz z zzz zzz zzz zzz zzzzz z zzz zzz zzz zzz zzz zzz zzz zzzzz zz zzz zzzzz
8 zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz z zzz zzz zzz z zzz zzz zzz zzz zzz zz zz zz zz zzzz zzzzzzzz z zzz zzzzz z zzzzz zz zzz zzz zzz zzz zzzzz z zzz zzz zzz zzz zzz zzz zzzzz zzz zzz zzzzz z zzz zzz zzz zzz zzzzz z zzzz zzzz zzzz zzzz zzzzz zz zzz zzzzz
9 zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz z zzz zzz zzz z zzz zzz zzz zzz zzz zz zz zz zz zzzz zzzzzzzz z zzz zzzzz z zzzzz zz zzz zzz zzz zzz zzzzz z zzz zzz zzz zzz zzz zzz zzzzz zzz zzz zzzzz z zzz zzz zzz zzz zzzzz z zzzz zzzz zzzz zzzzz zz zzz zzzzz
0 zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz z zzz zzz zzz z zzz zzz zzz zzz zz zz zz zz zzzz zzzzzzzz z zzz zzzzz z zzzzz zz zzz zzz zzz zzz zzzzz z zzz zzz zzz zzz zzz zzz zzzzz zzz zzz zzzzz z zzz zzz zzz zzz zzzzz z zzzzz zz zzz zzzzz
- zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzzzz
= zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzz zzzzz
y zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzzzz
u zzz zzz zzz zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzzzz
i zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzz zzz zzz zzz zzz zzzzz
o zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzz zzzzz
p zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzz zzz zzzzz
[ zzz zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzzzz
] zzz zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzz zzz zzzzz
h zzz zzz zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzzzz
j zzz zzz zzz zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzzz zzzz zzzzz
k zzz zzz zzz zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzzz zzzzz
l zzz zzz zzz zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzzzz
; zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz z zzz zzz zzz z zzz zzz zzz zzz zzz zz zz zz zz zzzz zzzzzzzz z zzz zzzzz z zzzzz zz zzz zzz zzz zzz zzzzz z zzz zzz zzz zzz zzz zzz zzzzz zzz zzz zzzzz z zzz zzz zzz zzz zzzzz zzzz zzzzz z zzzz zzzzz zz zzzzz zzz zzz zzzzz
' zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzzz zzzzz
\ zzz zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzz zzzzz
v zzz zzz zzz zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzz zzzzz
b zzz zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzzzz
n zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzzzz
m zzz zzz zzz zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzz zzzzz
^ zzz zzz zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzzz zzzz zzzzz
& zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzz zzz zzzzz
* zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzzzz
( zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzzzz
) zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzz zzzzz
_ zzz zzz zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzzz zzzzz
+ zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzz zzzzz
: zzz zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzz zzz zzzzz
" zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzzz zzzzz
| zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzzzzzz z zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zz zzzz zzzzzzzz z zzz zzz zzz zzzzz

Each line is a program. First two letters are comments and should be removed from source code when you try to run it.

You just need to find out a brainfuck like language only use valid charset to get the power of turing complete...

I know I can golf more bytes. But I'm too lazy to working on it any more.

# Deoxyribose, all 35 characters in 753 bytes

6 ATGCATTCGCGTTAA
7 ATGCATTCTCGTTAA
8 ATGCATTGACGTTAA
9 ATGCATTGCCGTTAA
0 ATGCATTAACGTTAA
- ATGCATGTCCGTTAA
= ATGCATTTCCGTTAA
y ATGCATTTTCATTGGGGTCTTCGTTAA
u ATGCATTTTCATTCGGGTCTTCGTTAA
i ATGCATTTTCATGGGGGTCTTCGTTAA
o ATGCATTTTCATTAAGGTCTTCGTTAA
p ATGCATTTTCATTACGGTCTTCGTTAA
[ ATGCATTTTCATCTAGGTCTTCGTTAA
] ATGCATTTTCATCTGGGTCTTCGTTAA
h ATGCATTTTCATGGCGGTCTTCGTTAA
j ATGCATTTTCATGGTGGTCTTCGTTAA
k ATGCATTTTCATGTAGGTCTTCGTTAA
l ATGCATTTTCATGTCGGTCTTCGTTAA
; ATGCATTGTCGTTAA
' ATGCATGCTCGTTAA
\ ATGCATTTTCATCTCGGTCTTCGTTAA
v ATGCATTTTCATTCTGGTCTTCGTTAA
b ATGCATTTTCATGATGGTCTTCGTTAA
n ATGCATTTTCATGTTGGTCTTCGTTAA
m ATGCATTTTCATGTGGGTCTTCGTTAA
^ ATGCATTTTCATCTTGGTCTTCGTTAA
& ATGCATGCGCGTTAA
* ATGCATGGGCGTTAA
( ATGCATGGACGTTAA
) ATGCATGGCCGTTAA
_ ATGCATTTTCATGAAGGTCTTCGTTAA
+ ATGCATGGTCGTTAA
: ATGCATTGGCGTTAA
" ATGCATGAGCGTTAA
| ATGCATTTTCATTTCGGTCTTCGTTAA

Since A, C, G, and T were all allowed, how could I resist? I didn't need anything from the fairy.

• The ATG at the start of each line is the necessary start codon
• Then, this just pushes the codepoint of each character to the stack (one on each line) in the most inefficient possible way; each CATxxx pushes an integer up to 63, then each GGTCTT is an addition
• It then pops them straight out as Unicode characters (CGT)
• Each line ends with a stop codon (TAA), without which the program will just repeat forever

This could definitely get a lot shorter if I tried, but this isn't golf.

# Pyth, score 35, 147 139 bytes

I have asked the fairy to give me the character "9".

Try all of these online!

Verify!

# Explanation

Code       Char  Expl
C54        # 6   # Character with value 54
C55        # 7   #
%44 9      # 8   # 44 % 9
9          # 9   #
Z          # 0   # Initialized to 0 by default.
C45        # -   # Character with value 45
C192 %131  # =   # First take 192 % 131, then print character of that value
C121       # y   # Character with value 121
@tG19      # u   # G is initialized to "abcdefghijklmnopqrstuvwxyz", tail that and print char at index 19
@gG5 4     # i   # g is used for inclusive slice to remove characters before index 5.
@G14       # o   # ...
C112       # p   # Character with value 112
C91        # [   # ...
C93        # ]   # ...
@ttG5      # h   # ...
@G9        # j   # ...
@tG9       # k   # ...
@G11       # l   # ...
C59        # ;   # ...
C39        # '   # ...
C92        # \   # ...
@G21       # v   # ...
@G1        # b   # ...
@G13       # n   # ...
@G12       # m   # ...
C94        # ^   # ...
C%93 55    # &   # ...
C42        # *   # ...
C%95 55    # (   # ...
C41        # )   # ...
C95        # _   # ...
C43        # +   # ...
C%199 141  # :   # ...
C34        # "   # ...
C124       # |   # ...

I used the similar trick for most character so I did not repeat the explanations.

# Zsh + xxd, score 35, 478 bytes, fairy character -

tr AA 5-A<<<A
tr AAA 5-A<<<A
tr A-Z 5-A<<<D
tr @-Z 5-A<<<D
<<<$# <<<- tr R-Z 5-A<<<Z tr 12 x-z<<<2 tr 12 t-z<<<2 tr 123 g-z<<<3 tr R-Z g-z<<<Z tr Q-Z g-z<<<Z tr 12 Z-a<<<2 tr 1-4 Z-a<<<4 tr 12 g-z<<<2 tr 1-4 g-z<<<4 tr 1-5 g-z<<<5 tr A-G g-z<<<F tr A-Z 5-A<<<G tr 123 %-1<<<3 tr 123 Z-a<<<3 tr 123 t-z<<<3 tr 12 a-z<<<2 tr Q-Z g-z<<<X tr A-G g-z<<<G tr 1-5 Z-a<<<5 tr 12 %-1<<<2 tr A-Z %-1<<<F tr A-Z %-1<<<D tr @-Z %-1<<<D tr A-X Z-a<<<F tr A-Z %-1<<<G tr A-Z 4-A<<<G tr 12 !-Z<<<2 xxd<<<r>f tr 2 c<f>g xxd -r<g Try it online! Each program is on a separate line, except the last one (|) which spans 3 lines. -, which the fairy has given us, is a pretty essential character for programming in shell languages :P tr (for translate characters) turns out to be extremely useful here - most of these characters are easily obtained using 5 minutes and an ASCII chart, by creating a range that surrounds the character we want and "indexing" into it by translating a character. <<<, "here-string redirection", pipes a single word into the command (command <<< word $$\ \equiv \$$ echo word | command). This allows us to give input to tr, and if no command is given, it prints to stdout, so we can print literal strings like - too. Also,$# is the number of inputs, which is naturally 0 for a challenge like this.

Unfortunately, | can't be made with the tr technique because there are no accessible characters after it in ASCII to create a range around.

The available commands with our charset is limited, but I found xxd, which is a hexdump tool bundled with vim. The general idea is to create a hexdump of a single character that's close to |, translate some the hex characters to make them actually |, and un-hexdump (hexload?) it again.

# get a hexdump of r and write to the file f
xxd<<<r>f
# translate 2 to c, reading from the file f and writing to g
tr 2 c<f>g
# un-hexdump from the file g
xxd -r<g

In this case, we use r (0x72) and translate the 2 to a c for 0x7C (|). Since we can't pipe the commands into each other, we must redirect > to a file f and then read from it again with <, and do this again with another file g.

There may be a different approach to be taken here that uses more common commands and is shorter.

# shortC, score 35, 184 bytes

AP54
AP55
AP312
AP313
AP2352
AP45
AP1341
AP121
AP1141
AP2153
AP111
AP112
AP1115
AP2141
AP2152
AP2154
AP1131
AP1132
AP315
AP551
AP4444
AP1142
AP354
AP1134
AP1133
AP2142
AP2342
AP42
AP552
AP41
AP351
AP43
AP314
AP34
AP124

Uses P from the fairy.

## How it works

A is converted to int main(int argc, char **argv){

Pis converted to putchar( which outputs the character passed as argument after converting it to an unsigned char, which is equivalent to take the modulo 256.

E.g. AP54 is converted to something equivalent to:

int main(int argc, char **argv){
putchar(54);
}

Generated with this script

# HTML (w3m), 18 char

with an extra &

&#54
&#55
&#45
&#121
&#111
&#112
&#42
&#41
&#43
&#34
&#124
&#x3d
&#x5d
&#x5c
&#x5e
&#x5f
&#x3a
&

It is possible to output 6, 7, -, y, o, p, *, ), +, ", |, =, ], \, ^, _, :, &.

• @xigoi totally missed that. I think I can get more score now...
– tsh
Apr 14, 2021 at 9:10
• @xigoi You can only get one of & and ;, so escapes aren't possible Apr 14, 2021 at 9:11
• @pxeger use only &#54 without ; works on w3m. It may be invalid HTML, but as long as w3m recognize it...
– tsh
Apr 14, 2021 at 9:15
• Sorry that the original answer is invalid. As w3m actually output  for <q> instead '. I massed them up... So I removed it...
– tsh
Apr 14, 2021 at 9:26
• There should be a ; at the end of each &... html constructs. So there would be 17x5 + 10(10 of them are 6 characters long instead of 5) + 1 (the last literal &), ie 96 bytes. total (you don't need newlines between them) Apr 16, 2021 at 2:38

# Cubically, all 35 characters in 166 bytes.

(162 bytes possible; see third-to-last paragraph.)

Cubically is by PPCG user MD XF.

Each line is a Cubically program; omit the first two characters. Try it online!

//accessible via 3x3x3 cube
- @5
' F@5
& FR@5
* R@5
( DDR@5
) DR@5
+ FRF3@5   // F3 is valid Cubically for FFF, saving 1 byte
" DRF@5

//requires 4x4x4 cube (invoke with flag -4)
6 DFD@4
7 FRR@5
8 DD@4
9 FD@4
0 @3
= FFRR@5
; DRDR@5
: FFD@4

//requires 5x5x5 cube (invoke with flag -5)
y DRER3@5
u DEDR@5
i FS@5
o SER@5
p FRD@5
[ SDRR@5
] FRR@5
h FES@5
j DRF@5
k DRDS@5
l FRF@5
\ FD@4
v DDR@5
b DRDR@5
n DSR@5
m DR3@5
^ FDF@5
_ E@4
| FEF3@5

## Explanation

Cubically manipulates values on the surface of a Rubik's cube. (There is a sixth, off-cube memory location accessible via the command : from the keyboard's right half; as the arithmetic operators are also blown away there's not much use for it. Fairy: take a break.)

Accessible to us on the left-hand side of the keyboard are commands to rotate the (R)ight face clockwise 90 degrees, the (D)ownward face, the (F)ront face, the middle layer inward from the bottom (E), and the middle layer inward from the front (S). And, crucially, the @ command which outputs the subsequent memory location as an ASCII character. Finally, the sums of values across each face occupy memory values 0-5. So a command of @3 sums the values on face 3 and outputs the corresponding ASCII character.

A 3x3x3 cube can have maximum face-value 45, 4x4x4 maxes out at 80, and 5x5x5 at 125, so we'll need at least a 5x5x5 cube to reach required ASCII values. On a 5x5x5 D@1 produces the same output as DER@5 on a 3x3x3, so one could golf 2 bytes there by using a larger cube than necessary to produce ). But at that point it started to feel like I was golfing on invocation argument rather than on code, so I've restricted myself to the smallest cubes necessary to produce each character. By allowing a 5x5x5 cube even for smaller values, it's possible to golf 4 bytes: the two mentioned above and one each from FRR@5-4 --> DE@1-5 and FRF3@5 --> SER@2-4 producing 7 and +, respectively.

(It is possible to find shorter programs on larger cubes than some of these presented--for example, on a 7x7x7 @2 produces the same output as DRDR@5 on a 5x5x5. But that's starting to feel like complete shenanigans.)

Most of these programs have a half-dozen or more siblings that produce the same output at the same length. Simply: D & E or F & S are often interchangeable, particularly for shorter programs.

• Welcome to Code Golf, and nice first answer! Apr 17, 2021 at 16:04

# unary , 35 chars, 15297610066607123676 bytes

0 are used as extra char, also the only char used.

I will just give how many 0 are there

6 415301196285076
7 3322409570280596
8 24327480129166876
9 3040935016145860
0 415301196285660
- 2913391660822676
= 3217063028519132
y 402132826660380
u 25736500906368540
i 25736500906368540
o 3040935009656340
p 24327480077250708
[ 3040908012496020
] 194618112799745172
h 380116824301076
j 24327476755268756
k 194619814042150036
l 24327480077250780
; 194619841033334932
' 194619840618098836
\ 23163646650164164
v 3217062613296068
b 25840407707137756
n 380116876207044
m 3040935009656348
^ 1556944902397961364
& 24327480077262356
* 364173957602844
( 23307133286581980
) 2913391660822748
_ 12455559219183690900
+ 45521744700356
: 24327480129166868
" 206723264985755868
| 6308640661020

# Retina, 188 bytes, score 19

Fairy character: .

x

Counts number of xs in the input, which is 0 (1 byte)

xxxxx

Inserts 5 xs and counts the 6 boundaries (7 bytes).

xxxxxx

Inserts 6 xs and counts the 7 boundaries (8 bytes).

xxx

x

Inserts 3 xs, then inserts a further x at each boundary, then counts the resulting 8 boundaries (8 bytes).

xx

xx

Inserts two xs, then inserts another two xs at each of the three boundaries, then counts the resulting 9 boundaries (8 bytes).

1
TdRw

In the Transliterate function, d represents 0123456789, E represents 02468 and Rw represents zyx.._. After inserting a 1, this therefore transliterates the second digit into the second last letter y (9 bytes).

5
TdRw

Inserts a 5, then transliterates the sixth digit into the sixth last letter u (9 bytes).

x
TddxxxxRw

Inserts an x, then the x is the 21st source character so it translates into the 17th last letter i (14 bytes).

x
TdtxRw

Inserts an x, then the x is the 12th source character so it translates into the 12th last letter o (11 bytes).

x
TdxRw

Inserts an x, then the x is the 11th source character so it translates into the 11th last letter p (10 bytes).

x
TddxxxRw

Inserts an x, then the x is the 21st source character so it translates into the 19th last letter h (13 bytes).

x
TdEtxRw

Inserts an x, then the x is the 17nd source character so it translates into the 17th last letter j (12 bytes).

k:

x
TdExRw

Inserts an x, then the x is the 16th source character so it translates into the 16th last letter k (11 bytes).

x
TdExxRw

Inserts an x, then the x is the 16th source character so it translates into the 15th last letter l (12 bytes).

4
TdRw

Inserts a 4, then transliterates the fifth digit into the fifth last letter v (9 bytes).

x
TddExxRw

Inserts an x, then the x is the 26th source character so it translates into the 25th last letter b (13 bytes).

x
TdttxRw

Inserts an x, then the x is the 13th source character so it translates into the 13th last letter n (12 bytes).

x
TdtttxRw

Inserts an x, then the x is the 14th source character so it translates into the 14th last letter m (13 bytes).

x
Txw

Inserts an x and then transliterates it to an _. (8 bytes)

No other characters are possible, because the only source of arbitrary printable ASCII is via the p transliteration builtin.

• @nitsua60 Yeah, too much copy and paste, sorry.
– Neil
Apr 19, 2021 at 0:13
• Makes sense--I figured it was that, but didn't know the language well enough to be absolutely sure, myself. Apr 19, 2021 at 1:31

# Jelly, 35 characters, 188 bytes

3!
34DS
44DS
45DS

45Ọ
212%151Ọ
121Ọ
3r15SỌ
14RSỌ
111Ọ
112Ọ
13RSỌ
31x3SỌ
104Ọ
53x2SỌ
54x2SCAỌ
54x2SỌ
12x5SCAỌ
13x3SỌ
213%121Ọ
241%123Ọ
33x3SCAỌ
111CAỌ
111CACAỌ
215%121Ọ
13x3SCAỌ
42Ọ
41CAỌ
41Ọ
24x4SCAỌ
43Ọ
211%153Ọ
34Ọ
124Ọ

Try it online!

Using as the extra character. Each program is on a separate line. A lot of these are kind of last-resort and I'll try to golf them.

## Explanation

• ! = factorial
• D = decimal digits
• S = sum
• = convert to character
• % = modulo
• r = range from m to n
• R = range from 1 to n
• x = repeat
• C = 1 - n
• A = absolute value

# Vyxal, all 35 characters, 243 bytes

54C
55C
55 1+C
55 2+C
45 3+C
45C
51 5d+C
121C
111 3d+C
5d2e5+C
111C
112C
5 4+2e5d+C
52 41+C
5d2e4+C
5d2e3d+C
5d2e3d+1+C
5d2e4d+C
54 5+C
35 4+C
44 2+dC
115 3+C
45 4+dC
5dD2e+C
5d2e4 5++C
45 1+d2+C
35 3+C
42C
5dddC
41C
45d5+C
43C
55 3+C
34C
124C

Try it Online!

The extra character is +

• Golfs for you (You can probably do more with T in 2.6) Dec 5, 2021 at 6:34

# Hexagony, score 35, 180 152 bytes

This is split out of my own Labyrinth answer, because it now adds some more real tricks over the previous, and therefore the resulting code is sufficiently different. Refer to that answer for Secret 1 and Secret 2.

6 54;@
7 55;@
8 R4;@
9 R5;@
0 !@
- 45;@
= R53;@
y r5;@
u r1;@
i W3;@
o q5;@
p 112;@
[ Z51;@
] Z53;@
h W2;@
j W4;@
k W5;@
l q2;@
; 315;@
' 551;@
\ Z52;@
v r2;@
b 354;@
n q4;@
m q3;@
^ t14;@
& W42;@
* 42;@
( 552;@
) 41;@
_ 351;@
+ 43;@
: 314;@
" 34;@
| 124;@

Try the comprehensive test online!

The exact same construction as the Labyrinth answer also works with Hexagony, because the two languages share the digit commands and the character output behavior. The output command is ; (unlocked with fairy). But Hexagony has one more quirk two more quirks. One makes it so that the (almost) same code only works by coincidence:

### Secret 3

A Hexagony program is laid out on the smallest hexagonal grid that fits the entire source code before running. For the programs of size 2 to 6, the hexagon side length is 2:

A B
C D E
F G

The IP starts at A, facing right. When it exits through B, it re-enters through C. When it exits through E, the current value is checked, and fortunately it is always positive (since the constant set up is still there), so it re-enters through F. Therefore, the IP flows through ABCDEFG, exactly in the linear order.

The other actually contributes to golfing the code further:

### Secret 4

In addition to the digit commands, the uppercase/lowercase letters in Hexagony are also valid commands, which simply set the current memory cell to its own ASCII value. And we have half of those letters available, and this leads to a new opportunity in golfing "certain ascii modulo 256"!

Since the existing literals are at most 4 bytes long, we only need to check the combinations of <letter><digit> and <letter><digit><digit>. I wrote a quick brute-forcer for it, and it turns out that we can save whopping 28 bytes in total.

# Husk, score 35, 198 bytes

6 D3
7 >1D4
8 D4
9 >1D5
0 Dc1
- ;c45
= ;c>1D31
y ;c121
u ;c<121 4
i ;c>1D53
o ;c111
p ;c112
[ ;c>11D51
] ;c>11D52
h ;cD52
j ;cD53
k ;c>1D54
l ;cD54
; ;c>3D31
' ttsc32
\ ;cDD23
v ;c<121 3
b ;c>4D51
n ;cD55
m ;c>1D55
^ ;c<D51D4
& ;c<41 3
* ;c42
( ;c<41 1
) ;c41
_ ;c>11D53
+ ;c43
: ;c>4D31
" ;c34
| ;c124

The additional character is ;; it is equivalent to R1. < and > yield the absolute difference between their arguments if the comparison is successful. The only real nontrivial programs here are Dc1 and ttsc32.

# Numberwang, score 35, 1169 bytes

6 65656565656565656565643
7 656565656565656565656433
8 6565656565656565656565613
9 6565656565656565656565623
0 656565656565656565633
- 6565656565656565656333
= 656565656565656565656565613
y 656565656565656565656565656565656565656565656565613
u 6565656565656565656565656565656565656565656565623
i 65656565656565656565656565656565656565656565656233
o 65656565656565656565656565656565656565656565613
p 65656565656565656565656565656565656565656565623
[ 656565656565656565656565656565656565613
] 656565656565656565656565656565656565633
h 6565656565656565656565656565656565656565643
j 656565656565656565656565656565656565656565613
k 656565656565656565656565656565656565656565623
l 656565656565656565656565656565656565656565633
; 6565656565656565656565643
' 65656565656565643
\ 656565656565656565656565656565656565623
v 6565656565656565656565656565656565656565656565633
b 65656565656565656565656565656565656565633
n 656565656565656565656565656565656565656333
m 656565656565656565656565656565656565656565643
^ 656565656565656565656565656565656565643
& 65656565656565633
* 6565656565656565623
( 65656565656565656233
) 6565656565656565613
_ 65656565656565656133
+ 6565656565656565633
: 6565656565656565656565633
" 656565656565643
| 656565656565656565656565656565656565656565656565643

Numberwang is a language based on Brainf**k where all commands consist of single numbers.

From the original character set we could use:
1 - decrement the pointer (to point to the next cell to the left)
2 - decrement (decrease by one) the byte at the pointer
3 - output the value of the byte at the pointer
4 - start of loop, needs corresponding 7. Skips loop if active pointer equals 0 Useless without a 7
5 - directly decrements the current pointer with the following number

Using only the allowed characters we could get a 2572 bytes solution by keeping decrementing by 5 with 55 and then subtracting the remainder of the division $$\(256-charcode)/5\$$.

But luckily the fairy comes in and gives us:
6 - directly increments the current pointer with the following number

With this new command and the fact that the password is composed of only ASCII characters (<127) we can add up from 0 (which is clearly better then subtracting from 256) in steps of 5 with 65, and then add the remainder of $$\(charcode)/5\$$.

# Whitespace, score 35, 498 bytes

Uses only \n, \t, and , which are all allowed:

6

7

8

9

0

-

=

y

u

i

o

p

[

]

h

j

k

l

;

'

\

v

b

n

m

^

&

*

(

)

_

+

:

"

|

## Explanation

• For 67890, the number is pushed to the stack (SS number N) and printed as a number (TNST).
• For everything else, the ASCII code of the character is pushed to the stack (SS number N) and printed as a character (TNSS).

Try it all online!

## Groovy, score 35/35, 397 380 bytes

Fairy character: "h". Each character is a one-statement program.

/* 6 */ 3<<1
/* 7 */ 22%15
/* 8 */ 1<<3
/* 9 */ 24%15
/* 0 */ 1%1
/* - */ 45as char
/* = */ 122>>1as char
/* y */ 121as char
/* u */ 234>>1as char
/* i */ 211>>1as char
/* o */ 111as char
/* p */ 112as char
/* [ */ 212%121as char
/* ] */ 214%121as char
/* h */ 13<<3as char
/* j */ 53<<1as char
/* k */ 214>>1as char
/* l */ 54<<1as char
/* ; */ 211%152as char
/* ' */ 121%41as char
/* \ */ 23<<2as char
/* v */ 241%123as char
/* b */ 211%113as char
/* n */ 55<<1as char
/* m */ 221%112as char
/* ^ */ 215%121as char
/* & */ 122%42as char
/* * */ 42as char
/* ( */ 5<<3as char
/* ) */ 41as char
/* _ */ 321%113as char
/* + */ 43as char
/* : */ 232>>2as char
/* " */ 34as char
/* | */ 124as char
• Dropped 17 bytes by switching to bit shift operators when shorter than modulo. Apr 17, 2021 at 21:34

# 05AB1E, score 35, 162 149 bytes

Uses the characters !12345<>RTxç.

6 3!
7 3!>
8 4x
9 T<
0 1<
- 45ç
= 15>Rç
y 121ç
u 115>>ç
i 52x>ç
o 111ç
p 112ç
[ 45x>ç
] 45>x>ç
h 52xç
j 53xç
k 54x<ç
l 54xç
; 31<x<ç
' Txx<ç
\ 23xxç
v 5!<<ç
b 25x<xç
n 55xç
m 54x>ç
^ 24x<xç
& Tx<xç
* 42ç
( Txxç
) 41ç
_ 24xx<ç
+ 43ç
: 15x<xç
" 34ç
| 124ç

Try it online!

& can be printed with CCxç, but this doesn't work with my test suite :/.

# Fission 2, score 35, 371 bytes

6 R'5@$@!A 7 R'5@$$@!A 8 R'5@$$$@!A
9 R'5@@!A
0 R'%@$$@!A - R'%@$$$$@!A = R'<@@!A y Rx@@!A u Rt@@!A i Rg@$$@!A
o Rg@@!A
p Rg@$@!A [ R'Z@$@!A
] R'Z@$$@!A h Rg@@!A j Rg@$$$@!A k Rg@@!A l Rg@$@!A
; R'5@$$@!A ' R'%@$$@!A
\ R'Z@$$@!A v Rt@$$@!A
b Ra@$@!A n Rg@$$@!A m Rg@$$@!A ^ R'Z@@!A & R'%@$@!A
* R'%@$@!A ( R'%@$$@!A ) R'%@$$$$@!A _ R'Z@$$$$@!A + R'%@$$@!A : R'5@$@!A
\ R'Z@$$@!A " R'!@@!A | R'z@$$@!A

Thank god there was some letter in there that could destroy atoms.

# Actually, 35 characters (18 complete), ??? bytes

The only interesting ones are:

6 3!
7 3!FD
8 3!F
9 3!FDFDDDD
0 1D
- 4f\$F

The others are just "make some number with F and D and then change it to a char with c".

= 3!FDFDDFDDDDDDDDDDDDDDDDDDDDDDDDDDDDc
y 3!FDFDFDDDDDDDDDDDDDDDDDDDDDDDc
u 3!FDFDFDDDDDDDDDDDDDDDDDDDDDDDDDDDc
i 3!FDFDFDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDc
o 3!FDFDFDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDc
p 3!FDFDFDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDc
[ 3!FDFDFDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDc
] 3!FDFDFDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDc
h 3!FDFDFDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDc
j 3!FDFDFDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDc
k 3!FDFDFDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDc
l 3!FDFDFDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDc

# asdf, 35 chars, 1420 bytes

6 asaasaaaasssasaaaasssasaasssasaaaasssasaa
7 asaasaaaasssasaaaasssasaasssasaaaaaa
8 asaasaaaasssasaaaaaasssasaaaaaa
9 asaasaaaasssasaaaaaasssasaaaasssasaa
0 asaasaaaasssasaaaasssasaaaaaaaa
- asaasaaaasssasaasssasaasssasaaaasssasaasssasaa
= asaasaaaasssasaaaaaaaasssasaasssasaa
y asaasaasssasaaaaaaaasssasaaaasssasaa
u asaasaasssasaaaaaasssasaasssasaasssasaasssasaa
i asaasaasssasaaaasssasaasssasaasssasaaaasssasaa
o asaasaasssasaaaasssasaasssasaaaaaaaa
p asaasaasssasaaaaaasssasaaaaaaaa
[ asaasaasssasaasssasaasssasaaaasssasaasssasaaaa
] asaasaasssasaasssasaasssasaaaaaasssasaasssasaa
h asaasaasssasaaaasssasaasssasaasssasaaaaaa
j asaasaasssasaaaasssasaasssasaasssasaasssasaasssasaa
k asaasaasssasaaaasssasaasssasaasssasaasssasaaaa
l asaasaasssasaaaasssasaasssasaaaasssasaaaa
; asaasaaaasssasaaaaaasssasaasssasaaaa
' asaasaaaasssasaasssasaaaasssasaaaaaa
\ asaasaasssasaasssasaasssasaaaaaasssasaaaa
v asaasaasssasaaaaaasssasaasssasaaaasssasaa
b asaasaasssasaaaasssasaaaaaasssasaasssasaa
n asaasaasssasaaaasssasaasssasaaaaaasssasaa
m asaasaasssasaaaasssasaasssasaaaasssasaasssasaa
^ asaasaasssasaasssasaasssasaaaaaaaasssasaa
& asaasaaaasssasaasssasaaaasssasaaaasssasaa
* asaasaaaasssasaasssasaasssasaasssasaasssasaasssasaa
( asaasaaaasssasaasssasaasssasaasssasaaaaaa
) asaasaaaasssasaasssasaasssasaasssasaaaasssasaa
_ asaasaasssasaasssasaasssasaaaaaaaaaa
+ asaasaaaasssasaasssasaasssasaasssasaasssasaaaa
: asaasaaaasssasaaaaaasssasaasssasaasssasaa
" asaasaaaasssasaasssasaaaaaasssasaasssasaa
| asaasaasssasaaaaaaaaaasssasaaaa

Accidentally find out some working languages... I have no idea what it is. Anyway, one program per each line. 2 chars at beginning of each line is not a part of the program.

• Was this made by you? It is just like a deadfish derivative and I never saw it before Apr 17, 2021 at 15:20
• @wasif I didn’t know it before.
– tsh
Apr 17, 2021 at 16:05