10
\$\begingroup\$

Cops thread
Robbers, your task is to crack a cops answer. Reveal the character that should be changed and what it should be changed to too. Please notify the cop if you cracked their challenge.

The robber winner is the user with the most cracks.
I will declare the winner cop and robber a week after this challenge is posted.

Example Submission

# Cracked [math's answer](http://example.com/17290/Change-a-character)

1[`a`|`b -> a

0[`a`|`b -> b

[Try it Online!](https://lyxal.pythonanywhere.com?flags=&code=1%5B%60a%60%7C%60b&inputs=&header=&footer=)
```
\$\endgroup\$

40 Answers 40

9
\$\begingroup\$

R, cracks Robin Ryder's answer

a=b=co2
for(a in 0:b)pi=pi+exists("c")/4
intToUtf8(pi)

Try it online!

The clue was in the exists("c") bit: c is a built-in function in R, so exists("c") will always be TRUE, even without the definition of a variable c on the first line. So we look for built-in variables starting with c... wait... there's one called co2 - one character away from c=2.
The first element of co2 is 315, and 315/4 equals 78.75, which after addition of pi and rounding to an integer equals 82, the ACII value of "R".

\$\endgroup\$
8
\$\begingroup\$

Python 3, 53 bytes, cracks dingledooper's 51 bytes

r=(1,)*8**9
r=r,len,str=r,str,sum
print(len(str(r)))

Try it online!

Replaces the newline at the end of the second line with . This is LATIN SMALL LIGATURE ST which is U+FB06, but Python 3 is apparently willing to interpret it as st in str. I spent some time thinking "if only I could make two letters" until I googled for "st ligature" which does just that.

The second line now redefines str as sum, and len as str, so len(str(r)) is now str(sum(r)), which is just the stringification of its length of r, which is 8**9. Also apparently the r=r in the trio of assignments overrules the left r=..., causing r to retain its original value.

\$\endgroup\$
1
  • \$\begingroup\$ Congratulations, I'm very pleased someone was able to solve it! Python identifiers are normalized during parsing, if that explains anything. \$\endgroup\$ Jul 21 at 7:43
7
\$\begingroup\$

Cracked A username's Vyxal answer

My complete lack of knowledge of Vyxal may have helped here as it allowed me to just try random things instead of trying to figure out what the obscure hack might be.

kaka(|←

Try it!

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Wow! I did not expect anyone to get that... \$\endgroup\$
    – emanresu A
    Jul 15 at 10:34
  • \$\begingroup\$ Third thing I tried, @Ausername! :D \$\endgroup\$
    – Shaggy
    Jul 15 at 10:34
6
\$\begingroup\$

Sisyphus, Python 2

print pow(2,2**1337133713371337,195889276175237072760362530940173700767)

I solved this by brute forcing the change needed to the modulus and exploiting the fact that \$a^x = a^{x \bmod \lambda(n)} \pmod n\$, where \$\lambda\$ is Carmichael's lambda function. This requires factoring \$n\$. Fortunately, the modulus is relatively small; had it been larger, we'd need to factor a large semiprime just to verify a guess.

\$\endgroup\$
1
  • \$\begingroup\$ Nice, this was the intended solution. \$\endgroup\$
    – Sisyphus
    Jul 16 at 10:06
6
\$\begingroup\$

Python 2, cracks xnor's answer

print 0in(0,0)>min(0,0)

Try it online!

\$\endgroup\$
5
\$\begingroup\$

Cracked Vyxal's lyxal answer

`Ẇ₁¹kḢ`«∧λf⇧\#¯ḣ⌐ƒż1

Try it Online!

Once I realized A) the lambda is useless because it always returns 1, and B) the target string consists only of lowercase letters and whitespace, the crack became trivial.

\$\endgroup\$
4
\$\begingroup\$

Vyxal, cracks A username's second answer 5 bytes

lyoax

Try it Online!

\$\endgroup\$
3
  • 2
    \$\begingroup\$ Yep! lyxal also worked, but rickrolled you \$\endgroup\$
    – emanresu A
    Jul 15 at 11:01
  • \$\begingroup\$ @Ausername really? \$\endgroup\$
    – math
    Jul 15 at 11:03
  • \$\begingroup\$ @math Yes. Try running lyxal# if you don't believe me. \$\endgroup\$
    – emanresu A
    Jul 15 at 11:03
4
\$\begingroup\$

Cracked tsh's answer

a=9
if(a>0)a=0xa>9&&print(a)

Replacing the newline moves the print to occur before the assignment; choosing x as the replacement character creates a hexadecimal value greater than 9.

Try it Online!

\$\endgroup\$
4
\$\begingroup\$

APL (Dyalog Extended), cracks Adám's second answer

≢∊⎕AT¨⎕A

Try it online!

is changed into T, making a totally different system function ⎕AT, "Attributes".

⎕AT takes a name, and gives some attributes about it. The only thing that is important here is that, given an undefined name, ⎕AT returns a row of (0 0 0)(0 0 0 0 0 0 0)(0)(''), which has 11 atoms in total. ⎕AT¨⎕A calls ⎕AT on each of the 26 uppercase alphabet, and since none is defined yet, returns 26 such rows. The total number of atoms in this array is 26×11=286.

\$\endgroup\$
3
\$\begingroup\$

Cracked A username's Vyxal answer

Ninjaed by pxeger :\

lyoax

Try it Online!

\$\endgroup\$
0
3
\$\begingroup\$

Cracked DLosc's Pip answer

-PZ-PI

Try it online!

I don't know how this language works, I just looked through the docs and found a PZ function.

\$\endgroup\$
2
  • \$\begingroup\$ Do you know what th PZ func does? \$\endgroup\$
    – math
    Jul 15 at 18:17
  • \$\begingroup\$ @math not really, but it's one of few operators that starts with a P (I also looked at all operators that end with an I) \$\endgroup\$
    – Daniel H.
    Jul 15 at 18:22
3
\$\begingroup\$

Cracked Daniel H.'s Rattle answer

d&|!p

Try it!

\$\endgroup\$
3
\$\begingroup\$

Vyxal, 24 bytes, cracks A username’s answer

kHø`string`D‟‟Ẋf∑vd∑qĖ₁Ẏ

Try it Online!

\$\endgroup\$
3
\$\begingroup\$

Jelly, 11 bytes, cracks Caird’s answer

“Y$Ḥß““¿<ȧ»

Try it online!

\$\endgroup\$
3
\$\begingroup\$

JavaScript (Node.js) by A username, 155 bytes

z=247275939563830539741033318025n
k=''
e='Hello, world'
while(z) k+=String.fromCharCode(Number(z%128n)),z/=128n;
console.log(eval([...k].reverse().join``))

Try it online!

Changes "console.log(e)" to "console.log;\n\t"

I mostly found this by narrowing down after which digit the console.log ended and then just spamming guesses until I found something syntactically valid that would eval to the same thing as console.log itself.

\$\endgroup\$
1
  • \$\begingroup\$ And a tab! There's a tab after the newline. \$\endgroup\$
    – emanresu A
    Jul 15 at 22:00
3
\$\begingroup\$

R, cracks Robin Ryder's second answer

a=b=2
for(a in 0xb)pi=a+a-pi
el(LETTERS[pi])

Try it online!

0xb denotes hexadecimal number b, or eleven. So the for 'loop' becomes just a single pass, setting pi equal to 11+11-pi, which is 18.85841.
LETTERS[pi] rounds this to the integer 18, and selects that capital letter: the 18th letter is "R".

\$\endgroup\$
3
\$\begingroup\$

R, cracks Robin Ryder's 3rd answer

x=z=6
y=0
while(x+7-1>y){x=x-1;z=z+1}
LETTERS[z]

Try it online!

Changes the first y in the while loop condition to a 7.

Cracked by educated manual semi-brute-force.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Well done! That's not the crack I had intended, so try your hand at this one. :-) \$\endgroup\$ Jul 16 at 19:31
3
\$\begingroup\$

R, cracks Robin Ryder's fourth answer

x=z=6
yy=0
while(x+yy->>yy){x=x-1;z=z+1}
LETTERS[z]

Try it online!

Preamble: R code encourages the use of the right-to-left assignment operator <- instead of = (as in x<-3 instead of x=3); this isn't seen much in code golf, of course, as it's one character longer. There is also a - much less used - left-to-right version, -> (so 3->x is equivalent to x<-3 and x=3), and - even less used - versions that assign into the parent scope: <<- and ->>.
The crack of Robin's answer uses this last one to sneakily assign x+yy directly to the variable yy, replacing the comparison in the while condition.

\$\endgroup\$
3
\$\begingroup\$

R, cracks Dominic's R answer

a=b=c=2
for(a in 1:b)c=c*3i
el(LETTERS[-c:0])

Try it online!

Our goal is to extract 18th letter ("R") from built-in LETTERS. It is to be done with here c=17 or c=-18. After noticing that pi is very close to a digit with an imaginary number [0-9]i, we can indeed conclude that 3i is our answer - for loop executes twice and effectively we multiply c=2 by 3i*3i=-9, which leads to c=-18.

\$\endgroup\$
3
\$\begingroup\$

Japt, cracks user's answer

"1,2"c@X+2

Try it online!

I know nothing about Japt, but found the c function while scrolling through the docs, which seems to map each character X -> f(X) by ASCII value. This works out nicely since "1,2" and "3.4" differ by an ASCII value of 2.

\$\endgroup\$
1
  • \$\begingroup\$ Nice, I'll try to come up with a harder one :P \$\endgroup\$
    – user
    Jul 18 at 18:19
3
\$\begingroup\$

R, cracks Robin Ryder's 5th answer

PO=0
TA=TO =min(0 * 0 * 0, FALSE, 0 * 0 * 0)
if(TA^TO)PO=18
LETTERS[PO]

Try it online!

Changes | (logical OR) for ^ (exponentiation). Zero raised to the power of zero is one, and so truthy.

\$\endgroup\$
3
\$\begingroup\$

><>, cracks A username's answer

After drawing some execution paths by hand, I replaced a / in the first line with a space.

\\ /   \     9    \
/\     /  /\  /   \\
    / 1/  \       \\\
\\ //  \  \\  /    \\\
 \\  /\ / \\\/ \   \\\\
 ///  \\   \ \//   // \\
/ /\  \\\ \/ \\ \  \\/ /
\\ / \  \\     /\\ // /
//  /     \\\   \\ \ \  \
\\\  /\\/// \ \\// /  \ +
///\ /\/\/ //   /    /
\\/\\/\/\/ / /// / /3 / n\
// \\     /         \ / /
  \ \/\/\/ / // // \/ /  /
\\  //\/\/ / / /  / ;
   \//\/\\ /\/\ /     /
 \  \    \//\ /    \/
 /       //  \ ///
/\\/\/ /\///\\ //
  \/\/
  //\\//\/     \\
 \\  \/    /\/ /\\
\ \  \/  \\  /  //
  \  \/  \/
     \     /\/ \/

Try it online!

The relevant commands are 1 9 + n ; I don't really know how the IP gets to this path, but here is the end of the new execution path:

enter image description here

\$\endgroup\$
3
  • \$\begingroup\$ Oh nice lol. My intended solution was... much more complicated. \$\endgroup\$
    – emanresu A
    Jul 26 at 10:10
  • \$\begingroup\$ Added the execution paths but I'm not sure it'll help... \$\endgroup\$
    – emanresu A
    Jul 26 at 10:57
  • \$\begingroup\$ @Ausername If you start drawing one execution path from the start and one from the ;, you have the solution as soon as they cross. So I guess they are more useful in solving than in understanding. \$\endgroup\$
    – ovs
    Jul 26 at 11:06
3
\$\begingroup\$

Julia 1.0, cracks MarcMush's answer

show(sum(count.(==('1'),bitstring.(Inf16[9973%36]))))

Try it online!

Int16 is the type for signed 16-byte integers. Inf16 is the 16-byte version of Inf, a value greater than all 16-byte floating-point values. Its binary representation is 0111110000000000, with the required five 1s.

\$\endgroup\$
1
  • \$\begingroup\$ well done! you found that faster than me finding hard looking numbers with no other solution than this one \$\endgroup\$
    – MarcMush
    Jul 27 at 15:57
2
\$\begingroup\$

Cracked DLosc's 2nd Pip answer

E***t

Try this code here

If you don't want to run the code yourself, this is what it looks like:

=== Welcome to Pip, version 0.21.07.05 ===
Enter command-line args, terminated by newline (-h for help):

Enter your program, terminated by Ctrl-D or Ctrl-Z:
E***t
Executing...
42
\$\endgroup\$
2
\$\begingroup\$

Vyxal o, cracks Aaron Miller's answer, 13 bytes,

`₴ḟ₴`₴`Buzz`F

Try it Online!

Vyxal's dictionary compression uses SCCs, two non-ascii characters joined together to make something that decompresses into a word. However, a single unmatched non-ascii character is a NOP, so replacing the space with that removes the space.

\$\endgroup\$
2
\$\begingroup\$

Rattle, 8 bytes, cracks Daniel H.'s answer

<[c]@I^p

Try it Online!

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Seems the Rattle docs are lacking somewhat; tried brute forcing this earlier using all the characters mentioned there, which doesn't include @. \$\endgroup\$
    – Shaggy
    Jul 16 at 23:54
  • 1
    \$\begingroup\$ @Shaggy It’s mentioned in the paragraph right below the command list. \$\endgroup\$ Jul 16 at 23:59
  • 1
    \$\begingroup\$ Ah, goddamnit! :\ \$\endgroup\$
    – Shaggy
    Jul 17 at 0:05
2
\$\begingroup\$

hyper-neutrino, Jelly

“5gỊƑ!ṆḥḌ³`⁻Ɓc?Ạ°þạḅI§Ɠ¦mṪ9ʂ:Nȯx1®Ḟ ƭḣTsÄẉṭ7|ẏẋzⱮɦḲ⁵.ṗbÐɱ8Ñ3"Øȧ¡Ė÷ʠ\¬ṇƥṀœṙRṅẈɓẒ#Ẏỵ⁼Ȧ©MỴƤ⁷ẹ⁴ż;OṃċẊnFḶ¤ȤḟỤẇçİ/ƒjƬhƙA2PẸtX¿ṢḢṡyiṂCd)ÆṣĠʋŒ-ė~YZ⁾ĿṘ²ŀ'ṄLȷU£BSƲɼṛñ½ȥÞ6pḂæ×ẆɠG4ịı$EƊ¹¥ḃɗ}DK]u*ġṚk⁹ɲḊµṾW_,ȧwß⁺⁸0ọv(<Ɲṁḍl=Q+ð@Çø[Żṫoera&Ọ¢Vḷ¶Ṗ€ƈḋ{⁶ƇĊqḄHḳJ⁽Ȯ%>^ḤṠfƘṬ‘Œ¿

Just brute force. Try it online!

\$\endgroup\$
2
\$\begingroup\$

R, cracks pajonk's answer

a=is.numeric
bb=strrep(11,1)
"if"(a(bb),LETTERS[a(bb)],"R")

Try it online!

as.numeric returns its argument coerced to numeric form; is.numeric - which conveniently differs by only a single character - returns TRUE if its argument is already numeric, and FALSE otherwise. FALSE is the case here, since bb is a character string (of digits).

\$\endgroup\$
2
\$\begingroup\$

Japt, cracks Shaggy's answer

PùÅÔÌ

Try it online!

This was pretty simple. Shaggy's original started with ¤ instead of P, which converted the input (0 if not given) to a base 2 string ("0"). However, P is the empty string. After that, ùÅ pads to length 1 using s, which is useless for the original, but turns the cracked version into "s", which is exactly what we want. Ô reverses the string and Ì gets the last character, so they're both basically no-ops for single-character strings.

Another crack

¤ù¤ÔÌ

Try it online!

This time, the Å is replaced with ¤, so that it pads with s to a length of two instead of just one, making the string s0. Ô reverses it and Ì picks the last character, s.

\$\endgroup\$
2
\$\begingroup\$

R, cracks Robin Ryder's 5th answer

PO=0
TA=TO =min(0 * 0 * 0, FALSE, 0 * 0 * 0)
if(T |TO&TA&TO)PO=18
LETTERS[PO]

Try it online!

Maybe another unintended crack...

I know nothing about R. I just know TRUE is truthy.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.