# Robbers' Challenge

Read the cops' challenge first.

In this challenge, you (the robbers) must find the correct string of characters, which, when added into the cop's code, will make it produce the correct (case-sensitive) output (except that there may also be an extra trailing newline at the end).

The number of characters you add in must be less than or equal to the number of characters removed from the original code, and your answer is still valid even if it was not intended.

The characters can be added anywhere in the code, but they must all be consecutive in the same place (i.e. not random characters dotted around the code).

Make sure to link the cop's post that you have cracked in your answer, and once you have posted your answer here, comment under the cop's post linking your answer if you have enough reputation.

## Example

Say a cop posted the following submission:

# Python, score of 14

Code: print(5*"a")
Number of characters removed: 1
Target output: 5 a (currently outputs aaaaa)

This is the answer a robber would post to crack it:

Character to add: , before the *
Resulting code: print(5,*"a")
Resulting output: 5 a

## Scoring

The following scoring criterion will be used in order (if #1 is a tie, then #2 is used to tiebreak, etc.):

1. The robber who has cracked the most cops' answers (that were uncracked at the time of posting) after 1 week wins!
2. Out of the tied robbers, the one whose most-upvoted answer has the most upvotes wins
3. Out of the tied robbers, the one whose most-upvoted answer was posted first wins

Good luck!

# Python 3, cracks Sisyphus' answer

print(dⅳmod(99,15))


Try it online!

Inserts dⅳmod where the ⅳ is U+2173 (Small Roman Numeral Four), a one-character multibyte ligature that normalizes to iv, letting us squeeze the built-in into 5 characters. I learned of this ligature trick for Python 3 in doing this crack.

• holy cow that works??? there really is no limit to the stupid golfing you can do in python Mar 30 at 7:01
• @des54321 ⅳ is 3 bytes while iv is 2. It will not help you golfing when answers are scored by bytes (which is default on this site) instead of characters.
– tsh
Mar 30 at 8:21

# JavaScript (Node.js), cracks l4m2's answer

console.log((99n**77n).toString(34))


Try it online!

### Cracking script

let s = "39iw027a2hnuqi2c1os255jmjsidafs3nx6496n8vl8dak0qc3r15xwheq4vxpb136up7rsmbm8v5slowjwf7mvj0s751b03gxif5";

// there's no 'y' and no 'z', so this could be an integer in base 36, 35 or 34
[36, 35, 34].forEach(base => {
let n = [...s].reduce((p, c) => p * BigInt(base) + BigInt(parseInt(c, base)), 0n);

console.log(Base ${base} ->${n});

// look for divisors of reasonable size
for(let d = 2n; d < 1000n; d++) {
let k = 0, N = n;
while(!(N % d)) { N /= d; k++; }

# Python, cracks pxeger's answer

"print("")"
print(__doc__)
""

Attempt This Online!

TIL you can store a string inside __doc__ by adding it on the first line.

# Python 3, cracks EphraimRuttenberg's answer:

print(str(...)[1:3]*50)


Try it online!

Added code: ... inside the str().

# Python 3, Cracks des54321's answer

print(str(quit)[14:18])


OR

print(str(exit)[14:18])


I brute-forced this by running:

import gc
for x in gc.get_objects():
if str(x)[14:18] == "Ctrl":
print(x)

• good one! I didnt even realize there were two solutions to this Mar 30 at 22:44

# Python 3, cracks thegreatemu's answer

import random as r
r.seed(258117)
print(r.random())


Try it online!

I just brute-forced six-digit seeds, which took 8 seconds to run on TIO.

• I should have added some spaces =P Mar 30 at 23:45

# MATL, cracks Luis Mendo's answer

'Hey My'YbtvZc


Try it online!

Adds the string YbtvZc to the end.

• Ohhh Yb returns a $1\times 2$ cell! I had 3etv1e which is incredibly close but not quite right. From the way it displays, 'Hey My'Yb really looks like it's a $2\times 1$ cell so I abandoned trying it. Apr 1 at 11:11
• I was also looking into using e based purely on the fact that Luis posted the cops answer :) Apr 1 at 11:16

# Cracks des54321's Python answer

Adding ^63 after chr(i results in:

print("".join(chr(i^63)for i in b'wZSSP\x1fhPMS[\x1e'))


...which outputs Hello World!

Try it online!

• damn that was fast, I knew this was fairly simple but I thought it would take a bit longer, well deserved +1 Mar 29 at 17:12
• @des54321 Well, I spent a lot of time today and yesterday coming up with a Python Cop challenge, but you beat me to it, so I though I'd put lots of effort into solving yours ;-). What made it easier what the fact that I'd thought of doing something almost identical, so I still had the ^ chr() for i in mindset. Mar 29 at 17:14
• great minds think alike I guess :P the fact I was only removing 3 characters also definitely limits the range of what could have gone in there. I did toy around with something more like this so that each character was transformed differently, but if I removed the two byte-strings there would be too many ways to crack it, and I couldn't think of anything short that wouldn't make it easily crackable Mar 29 at 17:19
• @des54321 Yeah, I saw this challenge in the Sandbox, and started writing a potential Cop answer in Python, thinking it would be easy to do. However, I still hadn't settled on something I liked even after two days. It was fun to crack, though! After I discovered that multiplying i by something didn't work, I actually brute-forced it by running a loop exactly like this. Mar 29 at 17:24
• My fault for making it too easy to bruteforce I guess :P I did consider throwing some more bitwise operators in there, but I confess I never even thought of multiplying i. I guess cause anything I tried that sent the encrypted string out of ASCII space wouldn't work, cause bytestrings can only be ascii (Although I suppose I couldve used the bytes() constructor and specified non-ascii encoding 🤔) Mar 29 at 17:30

### Crack for bigyihsuan'sLexurgy SC answer

a:
*=>w
b:
w=>zwq


Obviously not the intended solution, but seems to work fine.

• And this is why removing lots of characters from your cop answer isn't good :P it opens the gates for someone to do something cheeky like this Mar 29 at 17:26
• Not the intended solution, but a crack nonetheless, hehe. gj Mar 29 at 19:20

# R, cracks Robin Ryder's second answer

?=noquote#print
?"R"


Try it online!

The 8 characters to add are noquote#. This exchanges the asssignment of ? to the print function into an assignment to the noquote function, and comments-out the now-useless print.

# R, cracks Robin Ryder's third answer

{assign("?",print.noquote)}
?"R"


Try it online!

The 8 characters to add are .noquote, changing the print function into the rather-obscure print.noquote function.
This series of challenges was an uphill battle for poor Robin Ryder; I think neither of us was fully aware of the variety of noquote-like options and functions that lurk in base-R, and Robin patiently added more-and-more convoluted re-assignments and curly-braces to counteract each new noquote variant as it popped up in unintended cracks...

# Behavior, cracks Lince Assassino's answer

@(type:type)-0-3


Try it online! (you will have to input the program yourself)

Adds -3 to the end. Removing the -0 originally gives a result of cfunc, so I assumed -0 meant "remove the character at index 0." Using the same logic, we add -3 to remove the character at index 3 in func to get fun.

# Python, 124 bytes, cracks jezza_99's answer

import sys
S=sys.stdout
sys.stdout=type('',(),{'write':lambda x,y:'','flush':lambda z:1})()
import this
S.write(this.s[:98])

All of the re-added characters are at the end of the program.

Attempt This Online!

# PHP, cracks Michel's answer

<?php echo hexdec(M_E),'';


Try it online!

My first thought was, "maybe the number is large enough that printing it as a hex literal is shorter somehow...". When converting it to hex, I immediately notice that the hex digits are the first few digits of $$\ e \$$ (0x2718281828459). The rest is trivial.