# Transformers in Disguise (Robbers' Thread)

The cop's thread is here

The robber's task is to find a program of size equal to or less than the cop's program, which, when given an itself as input, produces the same output as the cop's program.

Additionally, even if a cop's answer is provisionally marked Safe and has been revealed, you can still crack it by finding an input that is not the same as the given source code, but still produces the same output.

## Rules:

• Submissions consist of
• Language name + flags
• Username of the cop with a link to the original post
• The cracked program
• An explanation would be appreciated
• Your goal is to crack the most Cop's programs

## Some Examples:

### brainfuck, xxx's submission

[,[>,]<[.<]]


This program simply reverses the input

Good luck!

# Node.js v10.9.0, Arnauld

o=>[...o].sort(n=>16&(j+=13),j=9).join


Try it online!

This outputs this particular permutation of itself when using Node's current sorting algorithm:

&nij.9=j.,)r31n=+(=ooj[o.o.)1.s](>=6>t


An insightful comment by l4m2 gave me a headstart, but I had to write a brute-forcer to figure out which permutation of digits gives the correct output...

• Note. Why the output should be unique: input length = output length, the compare function output (and the permutation) is independent of the array elements, and the permutation is invertible. Nov 15, 2018 at 4:25

# JavaScript Firefox, l4m2

btoa


btoa(btoa) encodes the following string (including linefeeds):

function btoa() {
[native code]
}


which gives:

"ZnVuY3Rpb24gYnRvYSgpIHsKICAgIFtuYXRpdmUgY29kZV0KfQ=="


# Python 3.6+, agtoever

print("".join([f"{ord(c)^170}" for c in input()]))


Since the byte count was 50 and there were 150 digits, I split it into groups of 3, and then guessed that some XOR had been applied to the ASCII representations of the characters so iterated over all possible XORs.

Try it online!

# Perl 6, donaldh

bag(get.comb).kv.sort.join.say


Try it online!

(This produces the same output for all permutations of the input, for example ().....aabbceggijkmnooorssttvy, but I strongly suspect that this is donaldh's program.)

• It's a fair cop. Busted. It really was too crude. Nov 7, 2018 at 11:57

# A Pear Tree, ais523

eval(x=q[print"eval(x=q[$x])"ne$_||exit|UPNR])


Try it online!

# Pepe, u_ndefined

Bit late back to this, but this looks to be simply add the character index to the char value

REEerEEReEeREEEEEeeeree


You can try it here. The permalink forces in breaks, but it should still work.

• Link: soaku.github.io/Pepe/#TELS1* - you have to click on the "compressed" link and then copy the page URL Dec 13, 2018 at 10:12
• @RedClover Tried that, but it put additional spaces in the code for me, so I left it for copy paste. Dec 16, 2018 at 17:58
• That's the expected behavior. I might improve the tool in the future, but I think it's good as it is now. Dec 17, 2018 at 14:31