# Unscramble the Source Code

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.

Perl, 20

ellir"lnto Wo d";prH

Hello World

Or...

Perl, 15

*3i)xp3rn3*x3t(

272727

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

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

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

# Unsolved Submissions

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

$(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="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></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> • @xnor Yes, that's what it means. – PhiNotPi Nov 4 '14 at 20:00 • You might want to forbid hashing... codegolf.stackexchange.com/questions/40304/… – NinjaBearMonkey Nov 4 '14 at 20:00 • 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 • I thought "Oh, il just write a malbolge program, scramble it, and win this thing!". But then, i tried to write a malbolge program. – rodolphito Nov 5 '14 at 4:56 • Warning: Cops, do not use Ideone to test your submissions, as it stores your programs and other people can see them. – rodolphito Nov 6 '14 at 4:48 ## 242 Answers # Befunge-93, size 17 (cracked) ## Code >_-,/""@ *#%+69pv  ## Output @  Looks like it has probably used some non-standard feature of this interpreter. # BBC BASIC, 187 - Cracked ## Code $((((((((((((((((((((()))))))))))))))))))))00000000111111111111111111111111122223333447778889999999CCCCCCCCCCCCCCCCCCCCCHHHHHHHHHHHHHHHHHHHHHINPRRRRRRRRRRRRRRRRRRRRRRT


## Output

you'll never crack me


## PHP, 54, Cracked

$$&(())11122;;;;<<====^^aaaabbbbbbceehhilow{}  ### Output 42  ## Original a=21;b=21;while(b){a^=b;b=(b&a^b)<<1;}echoa; Original idea • – jimmy23013 Nov 5 '14 at 18:21 ## Python 2 - 57 Cracked ### Code ''((()))+++++++,,,,.000000001111113444589abchiijmnnopprrt  ### Output blue  Blue is the best colour ;) • Cracked – Sp3000 Nov 5 '14 at 21:04 # PHP, 22 - Cracked by Martin Büttner ## Code: ((()))*+..0117;cehinot  ## Output: 7  ## Original echo(int)((.1+.7)*10); # PHP, 27 (Cracked by bwoebi) ## Code: $$((()))02679;;=__bdeehiinx


## Output (default on PHP 5.4.x):

3.1415926535898


## Output (default on PHP 5.5.x):

3.14159265359


Hint: It depends on your php.ini precision, so hopefully it's acceptable.

## Original:

$_=hex2bin(7069);die($_());

• Cracked ... hey, please make the next one a challenge, not cracked in 5 minutes; please :-) – bwoebi Nov 6 '14 at 1:10

# Java, size 108

## Code

forprintmymostfaultSent66{{{}}}.......;""(((())))%,*++//\\--''''''''''''main static class void public String


## Output

3.141593

• Cracked – feersum Nov 8 '14 at 19:05

# C, 28 (cracked by feersum)

0124689aimnpsssstu=;;&{}(())


Prints Hi!

• Cracked – feersum Nov 6 '14 at 16:08
• Drat, you beat me to it – squeamish ossifrage Nov 6 '14 at 16:09
• Oh come on ! 7 minutes ? You are awesomes guys. – Michael M. Nov 6 '14 at 16:11

Bash shell script, 33 characters

Code

{int wk1}'caller$' hop|hop sewer  Output shellpower  # Python 3, 46 ## Program ""''''((()))*01==bbffiiillnnnooooppprrrrrttt  Plus two newlines. ## Output '(otlotb)'  • Cracked – feersum Nov 7 '14 at 1:53 • @feersum: invalid link. Updated. – imallett Nov 7 '14 at 8:10 # Java 6+ / Oracle implementation (Cracked by feersum) ## Code (226 bytes) There are 5 new line characters and 2 spaces. No other invisible/non-printable character presents. """ ((((((()))))))++,........ 00000000000001122225677788 ;;;DEIPPSSS[\\\\\\\]aaaaaaaaaaaabccccccccddeeeeeeeeeeeef gggghiiiiiiiiiiiijllllmmmmnnnnnnnnnoooooopppppprrrrrrrr sssssstttttttttttttttttttuuuuuuuuuuuuuvvxxyyyz {{{{}}}}  ## Output 91 Unmatched closing ')'  The program has been tested to compile and run successfully on ideone, so please submit an answer with runnable demo there. feersum's solution is far from my intended solution, so I will not reveal my intended solution since I'm going to modify it for a new challenge. • Is there anything wrong with this submission? By the way, Oracle's implementation should be the most common one around. – n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳ Nov 5 '14 at 16:19 • By "run successfully" does that mean it doesn't throw an error? (So you actually System.out.println("91 Unmatched closing ')')" or something along those lines)? Or is the output just output from println, errors, etc. combined? – soktinpk Nov 5 '14 at 21:33 • @soktinpk: Output is to stdout. – n̴̖̋h̷͉̃a̷̭̿h̸̡̅ẗ̵̨́d̷̰̀ĥ̷̳ Nov 6 '14 at 2:15 • Cracked – feersum Nov 7 '14 at 8:42 # JavaScript, 285 ## Code \n\n\n\n\n\n """"""(((((((()))))))),,,,.........///////0001111222222333334566666777777889999:========ACCEGHJLLLMNORSTTX[]_aaaaaaaaaaaaaaaaaabbbccddddeeeeeeeeeeeeeeeeeefffffgghhhhhiiiiiiiiijlmmmmmnnnnnnnnnoooooooooooooooopppppqrrrrrrrrrrrrrrrrrrssssssssssssssstttttttttttttttuuuvvvwwwwxz  Note: The \ns are one character. ## Output AZ  # Python, 41 bytes ## Code: _dtrupar_p)o_(prm(txnrr_e)i)(mei er,(.)ps  ## Output: 6314  • Cracked... and -1 for being implementation-dependent :P – feersum Nov 7 '14 at 21:38 # Arithmetic (ECMAScript, Java, C, C++, BASIC, Perl, Python, Ruby), 31 # Code ((((((()))))))****++++111122222  # Output 77 • – NinjaBearMonkey Nov 8 '14 at 1:47 • Nice work both of you! – Cris Nov 8 '14 at 14:49 # Bash 23 characters long. Cracked by user23013 [link]. BASH_VERSION is "3.2.53(1)-release" Source (original) _(){ q=echo;$q "$q";};_ Source (scrambled) ;{e)$ qq"}";oh_$_=q(;c  Output echo  • I believe there should be one more space character. – jimmy23013 Nov 7 '14 at 10:11 • But it is still possible without that. Cracked. – jimmy23013 Nov 7 '14 at 10:20 ## C (gcc) - 43 - Cracked ### Code ""%%&(()),7;[]aabdeeefiiiimnnnnpprrsstuux{}  ### Output se7en  Trust me, you don't want to open this box... (My unscrambled code will only work in non-strict C. For example, here) ### Original main(superbia){printf(&unix["%se%den"],7);} • Is it permitted to output a newline after se7en? – feersum Nov 7 '14 at 21:58 • – nneonneo Nov 7 '14 at 22:03 • unix is an undeclared identifier for me. – feersum Nov 8 '14 at 12:30 • @feersum Yeah, I don't think this would've counted then, even if nneonneo hadn't cracked it. I thought that unix was still defined if your OS was unix based, but I guess I was wrong ;_; – FryAmTheEggman Nov 8 '14 at 15:06 • And if your OS isn't unix-based? – feersum Nov 8 '14 at 15:07 # Javascript (41 bytes) - Cracked It should be a piece of cake to crack. Here is the code: 'cccefhiinnnnooorrrrsstttttuuu)))} {(((.'  This is supposed to give the window object. Probably will work on node.js Have fun! P.S.: Please don't crack it!!! ## Python 2, 37 Code print(len(ord(Emvies.priwilimmstys))) Output: 1 • Cracked – Sp3000 Nov 8 '14 at 16:39 # Javascript (82 bytes) - Cracked Since my first Javascript attempt was cracked in 6 hours, I decided to make another one! Here it is: eval('zov=~-1+(ii=1<2);if(0^1<2 in[3]<=+[])ii+[zov]+[]<<ii;//cog=lovr;s.n,r,o.j');  As the PHP answer, you can run it and it will return 0. The unscrambled version outputs this: 131713115131713131131713115131713163131713115131713131131713115131713112713171311513171313113171386  I hope that this one survives a day. Have fun and don't crack it!!! • – jimmy23013 Nov 8 '14 at 15:55 # C, 63 (Cracked) ## Code int main(_){_;_<_<_;_=_;_______;printf("%d",_<=_<<_||_<<_<=_);}  ## Output 131088  ## Original Solution __;int main(_){__=_<<_<<_;__=_<<__;_<<=__|_;printf("%d",_|__);} • Cracked – feersum Nov 8 '14 at 12:28 # PHP (80 bytes) - Cracked Yes, this is one more answer from me! Here is a new one, fresh for you all: $$__=aAaAaa;$$___=(b^C^Fff^IIi);$$____=j^k^N^Oo^PPp;$$_____=Qrr+tTT.(UWW<XXyZ);;  As always: You can run it and it will print absolutely nothing. (same as the numeric value 0 converted to string) The output: :  That's right, 1 byte of output! Go ahead and have fun with this one! • – jimmy23013 Nov 9 '14 at 1:50 # PHP (33 bytes) - Cracked: This one is pretty easy to crack. It only works on linux. Scrambled code: X1dFu7Te48oklB ^ HDecnX0iTch0T6g;  Output (if everything goes right): 1  PHP (24 bytes): (I won't count this one, untested) This is the windows-only variation of the SAME code. The difference is the size and that I needed to add quotes. Scrambled: 'dc6iunXB7 ^ heoedcX4l';  Output: 1  Both scrambled codes can be run. Have fun!!! # PHP (46 bytes) - Cracked: Yet another one from me. This one is kinda easy. I did my best to have 1 and only 1 solution. Here it is: echo$o=rand(m^z&E+$i,$i=(H<Y)or$Y[$i+f<<z]);;;


And outputs:

band


As with some of my previous answers:

You can run the scrambled code.
Depending on it's mood, outputs either 0 or 1.

Have fun!

• – es1024 Nov 10 '14 at 11:37

## Bash 4.2.47(1) on Linux, 47 characters

${porcel-=str('pix fep\n pp/pp/'); fec1/; }  Output, without newline: pp  Finding some solution is easy: printf pp;o='${cel-sr(xe\     pp/pp/) fec1/; }'


Try to find the original code, without comment-like things like thow-away assignments or "hungry" identifier names.

• That's not how this challenge works though. ;) if you want people to find your original code, it's your job as a cop to make sure no other solution exists. – Martin Ender Nov 11 '14 at 7:32
• Cracked...it was very kind of you to post the solution! – feersum Nov 11 '14 at 23:47

# Python, size 37

### Scrambled:

"    "*+++.123334:=
=deefiinnoprrstuu


## Output:

12369.0


# PHP, 62 chars

"fine".Music <= radio?'==;;'(.')()+')+$yeTi:2('3(;)1$hoo.'.


## Output:

1. Monday 2. Tuesday


# Perl, 53 bytes

Code:

$thriller='24'&&$prng=4;tar xvw'~'.$e/=3332+42*$i/~\$r


Output:

3155242264414961265415109674813320


No trailing newline this time. Tested in Perl 5.18.2, but should work fine on other versions.

# Marbelous, 48 (Cracked)

## Code

_______&&--...../000000000011111111:<<=@@@@\{}}}


_ represents a newline.

## Output

"


(Yes, just one double quote.)

JS Marbelous Interpreter

Unlike many of my other Marbelous cops, this one does not use cylindrical boards.

• – jimmy23013 Nov 15 '14 at 9:08

# J 25

+3oh.5- #+-ii#3c!//4e.2%/


output

3


# Marbelous, 144

## Code

______________________________!!!&&+++++----..........////////0000000000000000000000111111227888::::::<<<<<<<<<=>>>>>>>>>@@@@@@AAOO\\\\^^^{}}}}}


_ represents a newline.

## Output

31 2F 2E 2C 2B 29 28 26 25 23 22 20 1F 1D 1C 1A 19 17 16 14 13 11 10 0E 0D 0B 0A 08 07 05 04 02 01


There is a space+newline at the end.

JS Marbelous Interpreter

Cylindrical boards required.

Hints: