Note: This challenge is now closed to new cop submissions. This is to ensure that no one can post submissions that only remain uncracked because there aren't enough robbers interested in the challenge anymore.

In this game of cops-and-robbers, each cop will write a simple program to give a single output. They will then make public four things about their program:

  1. The language
  2. The program length
  3. The desired output
  4. A scrambled-up version of the source code

Then, the robbers must unscramble the source code so that their program functions like the original.

Cop Rules

You are to write a simple program, which the robbers will try to recreate.

Your original program must have a simple functionality: upon execution, it outputs a single string/number and halts. It should give the same output regardless of when/where it is run, and should not depend on extra libraries or the internet.

Your program and output must use printable ASCII (newlines and spaces allowed). The output should be no more than 100 characters long, and the program should take less than about 5 seconds to run on a reasonable machine. You are also not allowed to use hashing (or other cryptographic functions) in your program

Then, you provide a scrambled-up version of the source code and the required output. You can scramble up your source code however you may like, as long as characters are conserved.

Your score is the shortest program you have submitted which hasn't been cracked. After a period of one week, an uncracked submission will become immune. In order to claim this immunity, you should edit your answer to show the correct answer. (Clarification: Until you reveal the answer, you are not immune and can still be cracked.) The lowest score wins.

Simple Example Cop Answers

Perl, 20

ellir"lnto Wo d";prH

Hello World


Perl, 15



Robber Rules

Robbers will post their cracking attempts as answers in a separate thread, located here.

You have one attempt at cracking each submission. Your cracking attempt will be an unscrambled version of the source code. If your guess matches the description (same characters, output, and of course language), and you are the first correct guess, then you win a point. It is important to note that your program does not have to exactly match the original, simply use the same characters and have the same functionality. This means there could be more than one correct answer.

The robber with the most points (successful cracks) wins.

Simple Example Robber Answers

Your program was print "Hello World";. (Although print"Hello World" ; could have also worked.)

Your program was print(3**3x3)x3

Safe Submissions

  1. ASP/ASP.Net, 14 (Jamie Barker)
  2. Befunge-98, 15 (FireFly)
  3. GolfScript, 16 (Peter Taylor)
  4. CJam, 19 (DLosc)
  5. GolfScript, 20 (user23013)
  6. Perl, 21 (primo)
  7. Python, 23 (mbomb007)
  8. Ruby, 27 (histocrat)
  9. SAS, 28 (ConMan)
  10. Ruby, 29 (histocrat)
  11. Python, 30 (mbomb007)
  12. JavaScript, 31 (hsl)
  13. Ruby, 33 (histocrat)
  14. Marbelous, 37 (es1024)
  15. Ruby, 43 (histocrat)
  16. PHP, 44 (kenorb)
  17. Ruby, 45 (histocrat)
  18. Marbelous, 45 (es1024)
  19. Python 2, 45 (Emil)
  20. PHP, 46 (Ismael Miguel)
  21. Haskell, 48 (nooodl)
  22. Python, 51 (DLosc)
  23. Python, 60 (Sp3000)
  24. Python 2, 62 (muddyfish)
  25. JavaScript, 68 (Jamie Barker)
  26. Mathematica, 73 (Arcinde)
  27. Haskell, 77 (proudhaskeller)
  28. Python, 90 (DLosc)
  29. C++, 104 (user23013)
  30. ECMAScript 6, 116 (Mateon1)
  31. C++11, 121 (es1024)
  32. Grass, 134 (user23013)
  33. PowerShell, 182 (christopherw)

Unsolved Submissions

In order of time of posting. This list courtesy of many users.

A small tool to verify solutions, courtesy of n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳

$(function(){function e(){var e=$("#ignore-space").is(":checked");var t=$("#source").val().split("").sort();var n=$("#editor").val().split("").sort();var r,i=0;for(r=0;r<t.length;){if(t[r]==n[i]){t.splice(r,1);n.splice(i,1)}else if(t[r]>n[i]){i++}else{r++}}$("#display").val(t.join(""));n=n.join("");if(e){n=n.replace(/[\r\n\t ]/g,"")}if(n.length!=0){$("#status").addClass("bad").removeClass("good").text("Exceeded quota: "+n)}else{$("#status").addClass("good").removeClass("bad").text("OK")}}$("#source, #editor").on("keyup",function(){e()});$("#ignore-space").on("click",function(){e()});e()})
textarea{width:100%;border:thin solid emboss}#status{width:auto;border:thin solid;padding:.5em;margin:.5em 0}.bad{background-color:#FFF0F0;color:#E00}.good{background-color:#F0FFF0;color:#2C2}
<script src=""></script>
<h3>Scrambled Source</h3>
<textarea id="source" class="content" rows="10"></textarea>
<h3>Unused Characters</h3>
<textarea id="display" class="content" rows="10" readonly></textarea>
<h3>Your Solution</h3>
<input type="checkbox" id="ignore-space" name="ignore-space"/>
<label for="ignore-space">Ignore space characters</label>
<div id="status" class="good">OK</div>
<textarea id="editor" class="content" rows="10"></textarea>

  • 4
    @xnor Yes, that's what it means. – PhiNotPi Nov 4 '14 at 20:00
  • 3
    You might want to forbid hashing...… – NinjaBearMonkey Nov 4 '14 at 20:00
  • 7
    You should probably specify that the winner must post the original source code after one week. What prevents me from posting gibberish and claiming that none of the robbers got the right answer? – user2023861 Nov 4 '14 at 21:54
  • 60
    I thought "Oh, il just write a malbolge program, scramble it, and win this thing!". But then, i tried to write a malbolge program. – Rodolvertice Nov 5 '14 at 4:56
  • 8
    Warning: Cops, do not use Ideone to test your submissions, as it stores your programs and other people can see them. – Rodolvertice Nov 6 '14 at 4:48

240 Answers 240

Python 3, size 74 (Cracked)

Python just wasn't the same after being re-educated by Big Brother.


print(war is peace)
print(freedom is slavery)
print(ignorance is strength)

There are two newlines at the end of lines 1 and 2.



Note that each True is in its own line.

  • 1
    What's behind door 101? – FryAmTheEggman Nov 7 '14 at 0:31
  • 4
    I originally had 2+2==5 as a fourth statement until I found that the = made it too easy. – xnor Nov 7 '14 at 0:32
  • 5
    Nice 1984 reference. – Justin Nov 7 '14 at 0:40
  • 2
    Cracked. That was excellent. – Sp3000 Nov 7 '14 at 1:41

Python 3, size 12 (Cracked)

print (abcd)

My program produces no output and no errors.

  • 4
    Cracked. Nice, the solution is very counter-intuitive. – matsjoyce Nov 4 '14 at 20:50
  • 2
    Very nice, I was going for int for a while. – Fox Wilson Nov 4 '14 at 20:51
  • @matsjoyce Nicely done. That was my intended solution. – xnor Nov 4 '14 at 20:53
  • 1
    @matsjoyce Yes, I expected someone would do this eventually. Still, I encourage everyone to not spoil themselves and try to solve it by hand. I assure you it's a cute solution. – xnor Nov 4 '14 at 20:56
  • I think I got it. The solution I found does not work if I first type python and then type my solution at the prompt. But it does work, if I put my solution in a file and type python file. – kasperd Nov 4 '14 at 22:45

CJam, size 20 (Cracked)


"Stop, Hammer time!"



Python 2, size 50


We already know the Answer to the Question, but what's the Question?


print *********************--///222222222222222222

Note that there are no trailing spaces or newlines. The only whitespace character is the single space after print.



I've attempted to balance code length and difficulty, but it wouldn't surprise me if I missed it a bit either way. Hopefully it's enough to discourage brute force, at least.

  • 2
    Cracked – Ypnypn Nov 4 '14 at 20:34
  • 6
    This would have been better with size 42. – a CVn Nov 5 '14 at 13:52

Pyth - 71 Cracked


C-3P0: "Sir, the possibility,..."* 
Han Solo: "Never Tell Me The Odds!"



*Originally, George Lucas had Han interrupt C3-PO.**

**He called this his greatest idea since Jar-Jar.

Interesting note: despite all the changes that Pyth has gone through, there is still a valid answer here!


ts,*s,y30 l" : : i i Han Solo "eP-C"h"TsrhT


The remaining characters go on the next line. Pyth only interprets the first line of a file.

ts, make a 2-tuple and get their sum -1.
* multiply:
s,y30 l"..." sum the 2-tuple containing 2*30 and the length of the string (18).
eP-C"h"T get the largest prime factor of h's ascii value minus 10 (47).
srhT get the sum of numbers from 0-10.

All in all, this basically just computes: (30*2+18)*(47)+55-1. After reading @isaacg's answer I noticed there is an extremely simple solution: *h30tC"y" which is 31*120.


*h30tC"y" "-P:Sir, e possibilit,...
Han Solo: Never Tell Me The Odds!"
Still works even after all this time...

Sorry for poor explanation formatting, I don't know how to use spoiler blocks :S (@Sp3000 made it a bit nicer for you, though)

Now you can run Pyth online! Try it here. Thanks @isaacg :)

  • 9
    The above may contain blatantly made-up information about the creation of Star-Wars. – FryAmTheEggman Nov 5 '14 at 16:49
  • 2
    cracked – isaacg Nov 6 '14 at 3:40
  • @FryAmTheEggman You can use tags in blocks, e.g. <br> – Sp3000 Nov 7 '14 at 14:50

CJam, size 51 [SAFE]


main(int argc,char* argv){printf("Hello, World!");}



You can play around with it in the online interpreter.

This should be more crackable than it looks.


Start with the second line of the output. A few digits don't appear in it all, and others suspiciously often. Why could that be? If you can decipher that, the rest should almost fall in place.


"that rrrrraging london Hail!v"{elccimf(;W))},(*,pa

The weather must have been pretty bad when I came up with that anagram...

The hint was supposed to point towards the fact that the second line is made up of squashed-together prime factorisations. I was hoping that from there it would be possible to determine how many and which characters go into the string, leaving only a few characters at the end.

  • 9
    Wait is this scrambled??? – TheDoctor Nov 9 '14 at 21:07

Befunge-98, size 15 [SAFE]






A curious but somewhat well-known feature of Befunge is that you can terminate a string with the same quote that begins it, which in essence pushes that entire line (except the quote) on the stack. As an extra trick, I re-use the same string again, by making use of u to reverse the instruction pointer. Then it's just some arithmetic: the core idea is to sum up all those values (which is done using k to repeat the + operation).

  • Which interpreter(s) have you tested it on, and in particular what assumptions do they make about cell bitwidth? – Peter Taylor Nov 13 '14 at 11:52
  • @PeterTaylor I've tested it on cfunge under x86_64 linux. Some testing seems to indicate it uses signed 64-bit integers, although I can say that my solution doesn't depend on overflow semantics so I'm not sure if it matters. – FireFly Nov 13 '14 at 12:37
  • Ok, so I shouldn't be looking for 8-bit overflows. Shame, that might have simplified it ;) – Peter Taylor Nov 13 '14 at 12:40
  • Ugh. I made programs to print 3312, 3300, and several others near 3314. So close... – Justin Nov 16 '14 at 19:39
  • @Quincunx excellent... :P – FireFly Nov 16 '14 at 20:40

GolfScript (16 bytes) [SAFE]


Expected output:


Original source:


  • Is this expected output excluding the trailing newline, or will the newline simply not be outputted? – ProgramFOX Nov 9 '14 at 18:22
  • @ProgramFOX, the output will end in a newline. The only ways I know of avoiding that would require :. – Peter Taylor Nov 9 '14 at 23:20

Ruby, 17 (Cracked)

Going for something really short this time.

inprt N=2,*'~~~%'



Python, 69 chars [cracked by grc]





This one's just a harmless bit of fun :) Tested on CPython 2.7.8, 3.3.2 and for the heck of it PyPy3 2.3.1.


Uses built-in functions str, dict, list to build up a string and then applies map with ord to convert the string to a list of ints, which are then summed.

Python, size 56 (cracked)


for i in "iprint()".join(([2,3,7,0,9,chr((-7+732^70)])))


hi mom

Python 3, 70 chars



Output (99 chars long):



It's been a week, so rather than posting the answer, here's a hint:

Try taking the square root of the number and working from there

Pyth, 11

\\,,"$: Ndw



JavaScript, 94 Cracked by FireFly

alert(' '' '''((()))+++,,,,,,,,,,,,,000111111114444577888;;;;;======[[[]]]aaafhinorrrrvvvxx||)


fun in the sun


a=alert;v='';r=[1,7,8,14,11,8,14,10,0,5,14,4,7,8];for(x in r)v+=('h'+(1==0)+a)[r[x]]||'';a(v);

  • I have a feeling, this won't work in all browsers/engines. What environment did you test this in? – Martin Ender Nov 10 '14 at 11:47
  • Cracked. – FireFly Nov 10 '14 at 12:30
  • Oh... and I was convinced you had alert first, since the indices matched up so well with the needed characters. Interesting coincidence. – FireFly Nov 10 '14 at 13:27
  • I actually had it first too when I started working on it, but I changed it to reduce browser differences. – SLuck49 Nov 10 '14 at 13:41
  • Doesn't work on Chrome. I have the latest version. It says Syntax Error: Unexpected String – Oliver Ni Jan 11 '15 at 3:57

Ruby, 38 - cracked by Martin Büttner






  • Cracked. – Martin Ender Nov 8 '14 at 14:14
  • 1
    @MartinBüttner Heh, nowhere near the original indeed. But your solution is possibly even more terrifying than the original. ;) – Doorknob Nov 8 '14 at 14:18
  • 1
    Hey there's a fish – TheDoctor Nov 9 '14 at 21:08
  • So the print and downcase! were red herrings. I expected the answer to use puts, did not think of $><<. – kernigh Nov 9 '14 at 23:08

Python 3, size 16 (Cracked)


help tim__rolo__

Output (with newline at end):

Hello world!
  • 3
    Cracked. – Martin Ender Nov 4 '14 at 21:16
  • 1
    @MartinBüttner I knew someone has seen the easter egg... – matsjoyce Nov 4 '14 at 21:18
  • 1
    I hadn't, but I was quick to google it. ;) To be honest, if I hadn't been in such a hurry, I probably could have seen that the remaining characters after hello were an anagram of import. ^^ – Martin Ender Nov 4 '14 at 21:18

Perl - 47 (cracked by grc)

Code (there is one space in there too)




You can run it online here and it does work under strict and warnings.

  • 1
    Is this a valid solution? – grc Nov 5 '14 at 5:54
  • @grc I'd say it is valid! Nice work! It prints the right thing. If you want some hints on the version that runs under strict and warnings let me know. – chilemagic Nov 5 '14 at 14:37

Ruby, 33 - cracked by user23013

enpsttux [[[]]]++\-\**????$$$$...




puts ?[+[*?*..?]][$$-$$]+?\\.next

  • Which version is this? – Lynn Nov 6 '14 at 23:07
  • @nooodl I have 1.9.3, but there's nothing version-specific about this one. – Doorknob Nov 7 '14 at 1:14
  • This is tough. Here's what I have so far: puts is obviously going to be the first thing there, .next is another keyword that can be used, and the rest is some sort of sorcery with ruby $ variables and character array creation.... +1 – Rodolvertice Nov 7 '14 at 1:19
  • Cracked. – jimmy23013 Nov 7 '14 at 15:22
  • @user23013 Nice! Not the original, though; I probably should have output characters that weren't actually in the source ;) – Doorknob Nov 7 '14 at 23:39

Python2, 132 characters

____        ,,,,:::''""""""""""((()))[[]]\\\0126aaaabcccceeeeeeeeeEffggiiiiiilllllmmmmnnnnnnooooopppppqqrrrrrrrrrssssStttttttuuvxxyy

Output (with a newline):


Updated version, 96 characters

Answer to original version suggested the exec instead of compile+eval, so here is a simplified version:

____       :::''""(())[[]]\\\0126aaabcccceeeeeeeeEffiimmnnnnooopppqqrrrrrrrrrssStttttttuuxxxxyy

Update: cracked

Fully cracked by Alex Van Liew and KennyTM. The original solutions were (scroll right to reveal the spoiler):

                                                                                                                                eval(compile('try: compile("from __future__ import braces","","single")\nexcept SyntaxError as q:\n\tprint q[0][6:12]',"","single"))
                                                                                                                                exec('try:exec("from __future__ import braces")\nexcept SyntaxError as q:\n\tprint q[0][6:12]')
                                                                                                                                The hint meant "Consider {}, which are not present in the source code".
  • How many newlines are there? – Sp3000 Nov 6 '14 at 14:42
  • None (not counting logical newlines like \n inside strings literals). With newlines the code could be shorter. – Vi. Nov 6 '14 at 14:48
  • 2
    +1 for not giving enough xs and cs for me to do what I want to do :P – Sp3000 Nov 6 '14 at 15:25
  • 1
    Shall I think up some hint? Let's start with a vague one: Don't count ones which exist. Count ones which do not exist. – Vi. Nov 9 '14 at 23:44
  • Cracked. – kennytm Nov 12 '14 at 23:10

Ruby, 29 [safe]

Trying to see how short I can get in Ruby without getting cracked.


paper view


[0][0, 3][0, 3, 6][0, 3, 6, 9][0, 3, 6, 9, 12][0, 3, 6, 9, 12, 16][0, 3, 6, 9, 12, 16, 20]


eval <<p*8 o=*o,$>.write(o) p


The first line creates a heredoc that starts on the next line and is delimited by the trailing p, then concatenates the resulting string to itself 8 times. Since it ends in a newline, this effectively creates a loop. The looped code assigns an array to the variable o, consisting of the elements in o.to_a (via the * shorthand), followed by the output of $<.write(o), which converts o to a string, prints it to STDOUT, and returns the number of bytes printed. A variable being assigned to for the first time is nil for the purpose of evaluating the right hand side, so on the first run *o is empty and write outputs nothing and returns 0. Each subsequent round outputs the array of bytes output on previous rounds. Using a p-delimited heredoc creates decoy methods for output, p and $><<, in the scrambled characters, that won't work because you need the bytecount.

PHP, size 49 [Cracked by Martin Büttner]


sub(print2w, $+expect+$+one+$+str+$+in=$@~main$);


  • Would you mind disclosing which PHP version you tested this with? – Martin Ender Nov 6 '14 at 1:12
  • @MartinBüttner I won't specify the exact range, but everything from 5.3.0 up will have the correct result. – bwoebi Nov 6 '14 at 1:15
  • 3
    Cracked. Only took like... 4 hours... – Martin Ender Nov 6 '14 at 1:50
  • @MartinBüttner wow, congratulations! Didn't expect you to not give up. :-) – bwoebi Nov 6 '14 at 1:53

MATLAB, 41 bytes

Cracked by feersum

((((((snowy leopards can like magic))))))



Perl, 36 ← cracked by grc





Tested here

Haskell, 100 Chars (Invalid, output too long)


while(syn==(+j)) tl+=b.a();
//(: #jquery :)\\
$("#jquery").on("click", j=>alert(j==m))




j(y:u)=let(q,c)=break(#y)u in y:j c//j q
  • 5
    I thought for a moment that I'm reading "Evolution of Hello World" question. – Vi. Nov 5 '14 at 1:45
  • 1
    @Vi yeah, but I think that the Levenshtein distance is a tiny bit more than 7 in this post. – Zaq Nov 5 '14 at 2:05
  • 1
    Output is longer than 100 chars – Lynn Nov 6 '14 at 22:50
  • 1
    @Zaq: the size limitation is not on code size, it's on output! – Lynn Nov 7 '14 at 0:11
  • 1
    Huh. And I guessed you did something with fix show. Definately uncrackable – proud haskeller Nov 7 '14 at 11:25

J, 22 bytes



Output (97 chars)


I expect this to be practically impossible...

CJam, 32 bytes (cracked)

Scrambled source

"Beware the Jabberwock, my son!"


  • 2
    Hm, where did you get the idea for using a quote as scrambled CJam code. ;) – Martin Ender Nov 6 '14 at 10:35
  • 1
    Cracked – jimmy23013 Nov 6 '14 at 13:02
  • @MartinBüttner: That's a line from a poem, not a movie quote. Entirely different! – Dennis Nov 6 '14 at 16:47
  • @Dennis Wait, mine wasn't from a movie either. (Not exactly from a poem, though. :D) – Martin Ender Nov 6 '14 at 17:32

Pyth - 35 - Cracked

In the spirit of @MartinBüttner:


"Programming Puzzles and Code Golf"



Try to decode it online here.

  • I've cracked it, but in the interest of getting more people to use Pyth, I'm temporarily removing my answer. – isaacg Nov 7 '14 at 5:02
  • Alright, cracked. – isaacg Nov 8 '14 at 10:31

TinyMUSH 3.1, 20




  • 6
    How are we supposed to run this? Where is the language reference? (The link doesn't help here). – n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳ Nov 6 '14 at 2:18
  • 3
    @n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀h You can run this code by connecting to a MUSH running the appropriate TinyMUSH version. Browse here to find one where Server Type is "MUSH", or download the server source from here and run a MUSH yourself. – Muqo Nov 6 '14 at 2:41

Python 3, length 110 [cracked by grc]

Scrambled (\n denotes a newline)

\n\n\n   ""((((())))),.......9::;===IOS[]__addeeegghiiiiiiiiijllmmnnoooooooppprrrrsssssssssstttttttttttuuuuuvwyyy


The better is Flat dense. break never of be do at never. If bad it honking

Here's another fun one - not meant to be hard, but just something unusual and puzzly. :)


The random-looking words are taken from the Zen of Python (PEP 20), which is automatically printed via the easter egg import this. The passage is just every ninth word, as hinted by the 9::[] present.
To extract every ninth word without automatically printing the passage when importing, we redirect sys.stdout to a StringIO().

Javascript, 29 - Cracked

Run in a Chrome browser console





Original code


protected by squeamish ossifrage Jan 10 '15 at 19:15

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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