# Which character to change (Robbers)

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

$$$$


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

r=(1,)*8**9
r=r,len,ﬆr=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.

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

# 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".

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!

• Wow! I did not expect anyone to get that... Jul 15, 2021 at 10:34
• Third thing I tried, @Ausername! :D Jul 15, 2021 at 10:34

# 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.

• Nice, this was the intended solution. Jul 16, 2021 at 10:06

# Python 2, cracks xnor's answer

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


Try it online!

Ẇ₁¹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.

lyoax


Try it Online!

• Yep! lyxal also worked, but rickrolled you Jul 15, 2021 at 11:01
• @Ausername really? Jul 15, 2021 at 11:03
• @math Yes. Try running lyxal# if you don't believe me. Jul 15, 2021 at 11:03

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!

≢∊⎕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.

lyoax


Try it Online!

-PZ-PI


Try it online!

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

• Do you know what th PZ func does? Jul 15, 2021 at 18:17
• @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) Jul 15, 2021 at 18:22

# Cracked Daniel H.'s Rattle answer

d&|!p


Try it!

kHøstringD‟‟Ẋf∑vd∑qĖ₁Ẏ


Try it Online!

“Y$Ḥß““¿<ȧ»  Try it online! # 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. • And a tab! There's a tab after the newline. Jul 15, 2021 at 22:00 # 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". # 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. • Well done! That's not the crack I had intended, so try your hand at this one. :-) Jul 16, 2021 at 19:31 # 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. # 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. # 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. • Nice, I'll try to come up with a harder one :P – user Jul 18, 2021 at 18:19 # 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. # ><>, 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: • Oh nice lol. My intended solution was... much more complicated. Jul 26, 2021 at 10:10 • Added the execution paths but I'm not sure it'll help... Jul 26, 2021 at 10:57 • @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. – ovs Jul 26, 2021 at 11:06 # 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. • well done! you found that faster than me finding hard looking numbers with no other solution than this one Jul 27, 2021 at 15:57 # APOL, cracks Ginger Industries' answer ƒ(56 ¿(%(I(I(∈ )) 4) ¿(F :(33:3():33::()) ¿(F 2 ¿(T(∈) 2 3))))((X)) )  Try it Online! I just went through each command and found what it did in the docs, and figured out that the condition on the last ¿ statement needed to return true, so I just put a True in there, and it worked. Here's some golfed code to achieve the same result: ƒ(56 ¿(%(∈ 4) 2))  Essentially, for every number x in the range [0..56), change the number to 2 if x % 4 is truthy, otherwise change it to None. # 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  # Vyxalo, cracks Aaron Miller's answer, 13 bytes, ₴ḟ₴₴BuzzF  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. # Rattle, 8 bytes, cracks Daniel H.'s answer <[c]@I^p  Try it Online! • Seems the Rattle docs are lacking somewhat; tried brute forcing this earlier using all the characters mentioned there, which doesn't include @. Jul 16, 2021 at 23:54 • @Shaggy It’s mentioned in the paragraph right below the command list. Jul 16, 2021 at 23:59 • Ah, goddamnit! :\ Jul 17, 2021 at 0:05 # 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!

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).

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.