142
41
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:
- The language
- The program length
- The desired output
- 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
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.
Simple Example Robber Answers
Your program was
print "Hello World";
. (Althoughprint"Hello World" ;
could have also worked.)Your program was
print(3**3x3)x3
Safe Submissions
- ASP/ASP.Net, 14 (Jamie Barker)
- Befunge-98, 15 (FireFly)
- GolfScript, 16 (Peter Taylor)
- CJam, 19 (DLosc)
- GolfScript, 20 (user23013)
- Perl, 21 (primo)
- Python, 23 (mbomb007)
- Ruby, 27 (histocrat)
- SAS, 28 (ConMan)
- Ruby, 29 (histocrat)
- Python, 30 (mbomb007)
- JavaScript, 31 (hsl)
- Ruby, 33 (histocrat)
- Marbelous, 37 (es1024)
- Ruby, 43 (histocrat)
- PHP, 44 (kenorb)
- Ruby, 45 (histocrat)
- Marbelous, 45 (es1024)
- Python 2, 45 (Emil)
- PHP, 46 (Ismael Miguel)
- Haskell, 48 (nooodl)
- Python, 51 (DLosc)
- Python, 60 (Sp3000)
- Python 2, 62 (muddyfish)
- JavaScript, 68 (Jamie Barker)
- Mathematica, 73 (Arcinde)
- Haskell, 77 (proudhaskeller)
- Python, 90 (DLosc)
- C++, 104 (user23013)
- ECMAScript 6, 116 (Mateon1)
- C++11, 121 (es1024)
- Grass, 134 (user23013)
- PowerShell, 182 (christopherw)
Unsolved Submissions
In order of time of posting. This list courtesy of many users.
- CoffeeScript, 96 (soktinpk)
- Python 3, 70 (Sp3000)
- TinyMUSH 3.1, 20 (Muqo)
- GolfScript, 32 (Beta Decay)
- Python 2, 101 (Mateon1)
- Lua, 49 (ChipperNickel)
- Python, 61 (imallett)
- Java 6+, 218 (nhahtdh)
- CJam, 51 (Martin Büttner)
- J, 22 (FireFly)
- Marbelous, 106 (es1024)
- Marbelous, 107 (es1024)
- JavaScript, 79 (FireFly)
- CJam, 47 (user23013)
- Rust, 118 + Clojure, 106 + others (Vi.) - version 2
- Marbelous, 144 (es1024)
- Python 2, 80 (MrWonderful)
- Perl, 53 (DLosc)
- Perl, 26 (primo)
- Mathematica, 31 (Arcinde)
- Marbelous, 144 (es1024)
- Assembly, 78 (krzygorz)
- J, 14 (algorithmshark)
- Java 8, 157 (TheBestOne)
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="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>
I think activity is slowing down... – mbomb007 – 2015-01-20T20:07:13.417
Would it be possible to post new cop submissions with an extended time limit for the robbers (for example, 1-2 months?) This could fix the problem of cops only winning because time ran out before any interested robbers cracked it. – ASCIIThenANSI – 2015-05-11T14:35:43.780
1Scramble means permute the characters? – xnor – 2014-11-04T19:58:58.680
4@xnor Yes, that's what it means. – PhiNotPi – 2014-11-04T20:00:33.363
3
You might want to forbid hashing... http://codegolf.stackexchange.com/questions/40304/code-crosswords#comment92987_40304
– NinjaBearMonkey – 2014-11-04T20:00:52.5172It might be an idea to maintain a list of uncracked submissions in the question, for when things get messy. – matsjoyce – 2014-11-04T21:17:09.760
1Does printable ASCII mean newlines are forbidden? – Dennis – 2014-11-04T21:28:46.033
@Dennis No, that wasn't my intent. – PhiNotPi – 2014-11-04T21:31:22.377
Can cops submit multiple programs? Also, are languages which may not be available to everyone (Mathematica) allowed? – Fox Wilson – 2014-11-04T21:34:43.153
1@FoxWilson I'll say yes to both of those. When a cop submits multiple programs, his score is the shortest uncracked one. – PhiNotPi – 2014-11-04T21:45:48.583
7You 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 – 2014-11-04T21:54:25.050
63I thought "Oh, il just write a malbolge program, scramble it, and win this thing!". But then, i tried to write a malbolge program. – rodolphito – 2014-11-05T04:56:18.793
@user2023861 I decided that would be a good rule. – PhiNotPi – 2014-11-05T05:01:41.283
2@PhiNotPi I took the liberty of adding a list of unsolved submissions to the question; hope you don't mind. – es1024 – 2014-11-05T05:51:32.540
@Rodolvertice How about a Brainfuck program? – Nzall – 2014-11-05T08:54:42.630
2Why should solutions by the authors be posted in the robbers thread as well? Why not just edit their answer here with the solution? – Martin Ender – 2014-11-05T12:53:00.220
1Can you use an error or function output as your code output? E.g.
php -r "blah"
would generate the output:Parse error: syntax error...
? – kenorb – 2014-11-05T13:51:55.900Added code golf, because the scoring is still "shortest wins". – Martin Ender – 2014-11-05T13:55:01.587
How about decompress functions (e.g. gunzip)? – kenorb – 2014-11-05T13:55:07.427
@MartinBüttner I was intending to keep all the solutions in the same thread, but it doesn't really matter to me. I changed it to "edit your answers" since that's what people seem to want. – PhiNotPi – 2014-11-05T17:13:14.200
I had fun with this (PHP) then realized it doesn't qualify since the output changes based on when you run it (displays current time)
_meet_Lost_leAch (need(feed)strong)lizards''meat''crate/Aeiou;
– Steve Robbins – 2014-11-05T19:22:35.313Please no one post anything in NP hard languages like Brainfuck - we would be doooooomed... – corsiKa – 2014-11-06T03:17:59.547
8Warning: Cops, do not use Ideone to test your submissions, as it stores your programs and other people can see them. – rodolphito – 2014-11-06T04:48:48.930
@Rodolvertice Can't you set the privacy setting? – Sp3000 – 2014-11-06T05:51:51.323
1@Sp3000 Had no idea that existed haha... Well it seems you need an account for true privacy (besides the link sharing secrecy option) – rodolphito – 2014-11-06T05:54:10.587
1How is "hashing" defined? – Ypnypn – 2014-11-06T14:31:30.863
2
srand
should probably count as a cryptographic function. – histocrat – 2014-11-06T23:49:41.570I love this site. – krs013 – 2014-11-07T04:56:30.960
Greetings OP. Is it possible for me to start a bounty of 200 points on my answer? Here is the link: http://codegolf.stackexchange.com/a/41295/14732
– Ismael Miguel – 2014-11-08T10:28:35.9601@IsmaelMiguel You can do it in the robbers' thread, but you can wait until someone cracks it. – Martin Ender – 2014-11-08T12:18:56.217
@user23013 Thank you for the edits, but you deleted the wrong link. You deleted this: http://codegolf.stackexchange.com/a/41295/14732 which is still uncracked, but you let this: http://codegolf.stackexchange.com/a/41340/14732 which was the cracked answer.
– Ismael Miguel – 2014-11-10T13:43:16.797Fixed. But it was deleted by @es1024. – jimmy23013 – 2014-11-10T14:05:13.897