# Which character to change (Cops)

Cops, your task is to chose a program that prints a string (you can choose). Although, if you change 1 character in your code, it should print another string.

But there's a twist: You should make your code hard to read, so that the robbers can't find your "changeable" character.

The winner cop is the user, with the shortest answer that wasn't cracked for a week.

Cops, please include the output that should be printed if that specific character is changed in your code.

I will declare the winner cop and robber a week after this challenge is posted.

### Example submission (very easy to understand)

# [Vyxal](https://github.com/Vyxal/Vyxal), 8 bytes, prints a and b

1[a|b


• @Shaggy It should output the string that the cop must have referenced in their post. Editing it.
– math
Jul 15 at 10:32
• But all answers can be trivially brute forced, using the exact same algorithm... how much time did you spend thinking before posting this? Did you post this to the sandbox? Jul 15 at 11:28
• @thedefault. in a Turing-complete language, this provably cannot be brute-forced in the general case. Just write a program that does some complicated looping and you'll never brute-force it Jul 15 at 14:11
• This seems like a very boring CnR, any answer will either be trivially brute forceable or take advantage of some weird unicode + halting problem thing that makes it very tedious and not really easily doable by a human anyway. Jul 15 at 21:51
• @pxeger Actually, if you use dovetailing you can always find the solution in finite time provided that one exists. Just run all the programs concurrently. The correct solution will eventually halt, and when it does you can stop execution. Jul 17 at 13:42

# Japt, 10 bytes, cracked by dingledooper

"1,2"k@X+2


Try it online!

The intended output is 3.4. I have no idea how hard this is to crack, since I barely know any Japt, but hopefully it's not too easy.

• I shall be leaving this one for others to attempt :) Jul 17 at 19:39
• @Shaggy Ah, so it is easy? :P
– rues
Jul 17 at 19:39
• as with my 2nd solution, when you know how ;) I think most people will figure out what needs to be done quite easily, but less so how to do it. (Sidenote: you could actually golf 2 bytes off this, but I shan't say what they are yet for fear of helping anyone solve it) Jul 17 at 19:42
• Even if it weren't easy, though, I would have left it for others to attempt. Jul 17 at 19:46
• Cracked Jul 18 at 2:24

# R, 77 bytes, cracked by tsh

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


Try it online!

As usual, the string to output is "R".

A previous version of this challenge allowed an unintended crack, found by Dominic van Essen:

## R, 71 bytes

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


Try it online!

• Cracked!... Jul 18 at 17:40
• Sorry... I've been trying to think-up my own challenges, so I've got a head full of 'tricks' ready to test... Jul 18 at 17:42
• @DominicvanEssen Nice find! That's not the intended crack, so I've edited in a variation which is immune to your crack. (Doing this rather than posting a new challenge, to avoid completely overwhelming this thread with R answers!) Jul 18 at 21:54
• Is this work?, another intended crack?
– tsh
Jul 19 at 2:00
• @DominicvanEssen I won't post it, as I might be able to recycle the idea into a vastly different challenge. :-) Let me know if/when you find it! Jul 19 at 8:49

# ><>, 536 bytes, Cracked by ovs

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


Try it online!

A literal maze of mirrors.

My intended solution was:


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

where the X is a \, and originally was a /.

Execution paths:

I'm not sure if this makes it more understandable or more confusing.

Red is path before the split, yellow is original, orange is correct path.

• Cracked
– ovs
Jul 26 at 10:05

# Julia 1.x, 53 bytes, Cracked by Robin Ryder

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


Try it online!

should output 5

• Cracked! Jul 27 at 11:54

“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ƘṬ‘Œ¿  Try It Online! The output should be: 690699296939718117350621606422816362267173158421165414491974510998788124940831200375657067696758989277663531427881606883007285313136136830578271394860909143130892610035752665368298072483371326623846259135567658705756844088966332891398225673436164647788793408591250973256547482034045337013090045826070073469995435050529779518827764039871801756995315995194485429761879045854501788974715014302780100588547060896111645050429507146677667643527115067082983636640551198432670539417621925424456729027  I imagine this shouldn't be difficult, even just to brute-force with Jelly's SBCS like someone in chat pointed out. I am working on a solution that will be slow to verify so that it is not brute-forceable (even though I don't think any of the other solutions have been brute-forced, I want to try this just for proof of concept), and using permutations or powersets is probably a good approach. The intended intended solution was to reverse the permutation index. However, for whatever reason, generating a random permutation of 1..250 and indexing into the codepage gave me a duplicate, so I'm not sure if I copy-pasted the wrong string or I'm just really fucking stupid. Either way, brute-force crack would be the only valid solution since I messed up the format. • Cracked (by brute force). Jul 16 at 16:51 • I haven't used the permutation for index built-in because your string has two repetitions: + appears both on positions 191 and 209, and ȧ appears both at 61 and 193 (so it is impossible for the correct input to be a permutation, and thus the 'find a permutation' built-in can't be helpful). In practice, it fails as expected (it returns an input that differs at 2 positions instead of 1) Jul 16 at 17:10 • @thedefault. wait... what? ... I literally had jelly generate me a random permutation of 1..250... oh well, good crack then Jul 16 at 17:13 # R, 48 bytes, cracked by pxeger x=z=6 y=0 while(x+y-1>y){x=x-1;z=z+1} LETTERS[z]  Try it online! Once again, the string to output is "R". I think and hope the solution is unique, but I might have missed something. Edit: indeed I had missed something... • Cracked Jul 16 at 18:26 • @pxeger Well done! That's not what I had intended, but I was scared I might have missed something like that. Back to the drawing board... Jul 16 at 18:46 # Brainf***, 51 bytes - cracked by dingledooper ++++++++++[>+++++++++++<-]>++.-------.+++++.++++++.  Try it Online! Right now it outputs pint. Can you make it output ohms? • Cracked Jul 21 at 3:59 • Wow, not even ten minutes! Good job! Jul 21 at 4:02 # J, 7 bytes, cracked by Adám 13024e0  Try it online! Outputs 13024. Cracked solution should output 69420 instead. • – Adám Jul 21 at 7:39 # Labyrinth, 7 bytes, cracked by m90 999 !!@  Try it online! Outputs 99. Change it to 9900. • – m90 Jul 21 at 10:44 # Yggdrasil, 3 bytes, cracked by A username ;.:  Try it online! Solution should print ..:. • Cracked Jul 24 at 22:02 # Vyxal, 14 bytes, Cracked by Aaron Miller ‛ø»:K:Ẋf∑$βS2Ẏ


Try it Online!

Should output 14.

My intended solution was:

»ø»:K:Ẋf∑\$βS2Ẏ


I'm quite surprised that changing the word worked, my intention was changing it to a number, where the output would be 1412 before slicing.

• Cracked Jul 27 at 14:45

# brainfuck, 29 bytes, Cracked by ovs

.+[.[->+>+<<]+[>--<+++++]>+<]


Try it online!

Should output

�:sIX=1
×}ð :kAH%  ÊoÕàQÍº#y8M!
§My¥ºûQèÕYÊ¿%A]:3 Ø}ñ
=pIU:+ÈeÉÊ/ºã9¸á
-Pº[±¨õ9Ê@á½:iÑ
g
¹eº»hÊå


SE swallowed some unprintables, so here's a hexdump:

00000000: 0001 c29d 3a73 4958 3d31 0ac3 977d c3b0  ....:sIX=1...}..
00000010: 09c2 953a 6b41 4825 09c3 8a6f c395 c3a0  ...:kAH%...o....
00000020: 51c3 8dc2 ba23 7938 4d21 0ac3 876d c390  Q....#y8M!...m..
00000030: c399 45c2 bac2 9bc3 b128 c2b5 79c3 8ac3  ..E......(..y...
00000040: 9f45 c380 c2a1 c3bd 3ac3 93c2 a918 5d11  .E......:.....].
00000050: 0ac2 b75d c2b0 c2a9 c3b5 3ac3 8bc2 a108  ...]......:.....
00000060: 45c3 a9c3 8a4f c2b5 20c3 b12d c2ba c283  E....O.. ..-....
00000070: c399 c3b8 6d01 0ac2 a74d c290 79c2 a5c2  ....m....M..y...
00000080: bac3 bb51 c3a8 c395 59c3 8ac2 bf25 c280  ...Q....Y....%..
00000090: 415d 3a33 09c3 987d c3b1 0ac2 973d 7049  A]:3...}.....=pI
000000a0: 553a 2b01 c388 65c3 89c3 8a2f c295 60c2  U:+...e..../...
000000b0: 91c2 8dc2 bac3 a339 c2b8 c28d c3a1 0ac2  .......9........
000000c0: 872d 5019 05c2 ba5b c2b1 c2a8 c3b5 39c3  .-P....[......9.
000000d0: 8ac2 9f05 40c3 a1c2 bd3a c293 69c2 98c2  ....@....:..i...
000000e0: 9dc3 910a 771d 30c3 a9c2 b53a c28b 61c2  ....w.0....:..a.
000000f0: 88c2 85c2 a9c3 8a0f 7520 31c3 adc2 ba43  ........u 1....C
00000100: c299 78c2 adc3 810a 670a 10c2 b965 c2ba  ..x.....g....e..
00000110: c2bb 1168 1519 c38a 7fc3 a5              ...h.......


And no, I don't know how I got this result.

• Are you sure your hexdump is correct? This seems to produce the same output, but is missing a few bytes
– ovs
Aug 15 at 10:20
• @ovs Yes, that is correct. I copied-and-pasted the output, so some bytes must've got lost in the process. Aug 15 at 10:32
• posted it
– ovs
Aug 15 at 10:57

# JavaScript (REPL), 17 bytes

a=!![],a++,a+=![]


Edit : Actually output "2", should output 3 when the good char is modified

(not sure if the console.log was required or not...)

https://jsconsole.com/

• A cop submission to this challenge must include an intended output string the robber should get. Nov 11 at 0:41
• I've added that ! :) Nov 11 at 0:47
• Welcome to Code Golf! This is a pretty tough cop, I've been trying for a little while to crack it. I don't think you need the console.log, although the question's a little unclear. Nov 11 at 0:58
• Cracked Nov 11 at 4:10

# PHP 7.4.2 - 23 bytes

echo md5("leetspeak!");

Let's go for another try ! :)

This one should output

20bff2eab610b29d183a363727b9bfb5

if correctly modified

https://wtools.io/php-sandbox