Programming Puzzles & Code Golf Stack Exchange is a question and answer site for programming puzzle enthusiasts and code golfers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is the cops' thread. For the robbers' thread, click here.

Cops' Task

  • First, write a quine in a language of your choosing.
  • Next, scramble the quine. Make sure to do this well as the robbers will be trying to unscramble it and find the original source code! Note that the scrambled code does not need to work.
  • Post an answer on this thread. Include the language, the byte count, and the scrambled code.

Your program may not print to STDERR.

Here is an example of a cop submission:

Python, 29 bytes

nt _%=_r;_riinp;pr_='t _%%%_'

Robbers' Task

For the robbers' thread, click here.

Safe Submissions

If your submission has not yet been cracked after a week of posting, you may add the solution and specify that it is safe. If you do not, your submission may still be cracked.

Scoring

This is , so the user with the safe submission with the fewest bytes will be the winner of this section.

Leaderboard

Here is a stack snippet to generate a learderboard for this challenge. For it to display properly, please format your submission like this:

# Language Name, N bytes

... other stuff ...

If your submission gets cracked, please format like this:

# Language Name, N bytes, [Cracked!](link)

... other stuff ...

If your submission is safe, format like this:

# Language Name, N bytes, Safe!

... other stuff ...

<script>site = 'meta.codegolf'; postID = 5686; isAnswer = false; QUESTION_ID = 99469;</script><script src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js'></script><script>jQuery(function(){var u='https://api.stackexchange.com/2.2/';if(isAnswer)u+='answers/'+postID+'?order=asc&sort=creation&site='+site+'&filter=!GeEyUcJFJeRCD';else u+='questions/'+postID+'?order=asc&sort=creation&site='+site+'&filter=!GeEyUcJFJO6t)';jQuery.get(u,function(b){function d(s){return jQuery('<textarea>').html(s).text()};function r(l){return new RegExp('<pre class="snippet-code-'+l+'\\b[^>]*><code>([\\s\\S]*?)</code></pre>')};b=b.items[0].body;var j=r('js').exec(b),c=r('css').exec(b),h=r('html').exec(b);if(c!==null)jQuery('head').append(jQuery('<style>').text(d(c[1])));if (h!==null)jQuery('body').append(d(h[1]));if(j!==null)jQuery('body').append(jQuery('<script>').text(d(j[1])))})})</script>

share|improve this question
7  
Closely related. (Same challenge except that answers didn't have to be quines.) – Martin Ender Nov 11 at 17:54
1  
Is the scrambled code supposed to also be a quine? Does it even need to be a valid program? I tried running the sample Python on codepad but it gets a syntax error. – milk Nov 11 at 18:57
    
@milk No, it doesn't need to be a valid program. – Oliver Nov 11 at 18:59

24 Answers 24

C#, 288 bytes

Stag is a great shoW.        "="=""="="Agent"plastic"Was"tryin"to"Release"an"Astroid"."$Money$"st@le"tigers"and"Agent"plastic"got"mad"."$Money$"sic","man","t0tally"rad"."Sistrs"Rms"titAnic";"Civic"Ace"in"{sC@m}{hic}{vicis}..{cats}sAc}((@))((@)){{{>>{{{{{{}}}}}}}}}\\\\\\\;;;(@)((@)()),,;;

My strategy is for all the short ones to get cracked and nobody bothers with this considering how long it is... Also I suppose I should note that this is a full program, not just a function.

share|improve this answer

MATL, 20 bytes. Cracked

It'D-whoLl&w#ck'f0Gz

Don't attempt to crack this. It'd wholly wack fogs.

share|improve this answer
    
Cracked – James Holderness Nov 13 at 21:01

JavaScript, 1574 bytes

I spent way too much time on this. Behold the obfuscation.

(notice that an unmatch parenthesis remains throughout the entire text.

dear "sir",

|    i cannot express my loathing to you and your things. they truly are a loathsome sight. (regar'less of their quality, they function as the most appalling devices...)[1]

|    these avocads of thine possession are most unpleasent. (ce n'est pas faux.) Queer; Careful; An' in total repulsing. in this form, those are not seulement cringe... So; CAB's is quite Cruel. (Cruel indeed...)

|    intention is not great (heh, intention, ;}) run, no, run, since {tu est le ;AqC;};

{{{{============================================}}}}

[1]: see? am i not insane? You may dictate the opposite, so i dictate thus.

9 + 4 is 13. Y is this. Y + 4 is 9 + 9 minus one. N is this. f(x) is {x + x}, so f(N) is N plus N is N + N is 3.

:^) i'm cruel; not so cruel.)
                                  rrrrrrrrrr 0nnnccnnggrrrrttssBBC
{({[}(<[<))(((((){{})}[}][[]{}(]))))|} f f r 0nnnccnngrrrrrttesBBA
())(((()))))()))()()()((((()))}{{})((} f f r 0nnnccnngrrrrrttesBBY
]]}(([][]{{{}}})()({}(){}{()}{}()[])][ f f r 4nnnccnngrrrrrttesBSY
))({})(}{)({{{{(()))())))))))()))()()( f f r 4nnnccnngrrrrrtpesqSY
)()()((((((((((Z))))))))()(()((()((((( f f r 5nnnccnngrrrrrtlefoSY
(((;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;''' f f r 3nnncccngrrrrxtleifSY
''''''''''''''''''',,,,,,,,[[[[[[]]]]] f f r 3nnncccngrrrrxtleifZQ
[ ] ] + + + + + + + + + + + + + + + ++ f f r 9nnncccggrrrrxtleifZQ
+ + + + too not fun...fffffffffffffuuu f f r 5nnncccggrrrrxtlli0ZQ
uuuuuuuuuuuu.. | | | |99S            ) f f r 0nnncccggrrrrxxll01QQ
share|improve this answer
    
avocads cracks me up! – Kritixi Lithos Nov 14 at 18:45

Underload, 20 bytes, Cracked!

~*)(a):*(*a:S(*S*~S)

I scrambled this via randomizing the order of the characters, because what could be more scrambled than random?

A correctly written Underload interpreter crashes when seeing a newline at the top level of the program. As usual in golfing competitions, there's no newline at the end of the program; I'm just placing this reminder here because it's very easy to add one by mistake when copying the program to an interpreter.

share|improve this answer
    
Welcome to PPCG! :) – Martin Ender Nov 12 at 11:42
2  
Well, I've been commenting indirectly on PPCG for a while by tracking down PPCG users on other forums (Reddit, IRC, etc.) and shouting at them until they post what I want. May as well do it directly :-) – ais523 Nov 12 at 11:46
    
Cracked. Thanks, this was a fun challenge. :) – Martin Ender Nov 13 at 13:13

Retina, 20 bytes, Cracked

S`(\?)\1*

S`(\?)\1*

The program (and output) contains exactly two linefeeds.

You can try Retina online here.

A small hint:

In the process of designing this cop, I found a new shortest Retina quine, which I'll post to our quine challenge once this answer is either cracked or safe.

share|improve this answer
    
I'm going to guess that there's a dry run * in there, and a \ as a configuration option to prevent an additional linefeed. – mbomb007 Nov 16 at 15:52

CJam, 39 bytes, Safe

!""$)+023345679:AEORYZZ\_```bbceeffimmz

Solution:

")A!0z`eZOmRZ$Yei`E"_`\32fm95b67b43f+:c

Uses some base encoding for obfuscation. However, since the characters are all in ASCII I would have thought someone might be able to figure out 32fm95b??b??f+:c which would be enough to brute force the rest.

share|improve this answer
    
I didn't know how to choose a permutation if I answered. Sorting is a good idea – Luis Mendo Nov 11 at 20:32

Pyth, 38 bytes, Safe

Not quite golfed, but works.

````::""@@@@++++22ggKKKKKKKKNNNNZZZZ

Unsorted version:

K"K++@KZ:`K@`NZNgK2"++@KZ:`K@`NZNgK2
share|improve this answer
1  
I have a quine but it's missing two of the @ and one 2... It's so close! – Steven H. Nov 18 at 21:38
    
Quick ! You don't have much time ! – FliiFe Nov 19 at 10:12
    
I think it's over. I can't figure it out... :( Congrats on getting a safe solution! – Steven H. 2 days ago
    
There you have the solution ! Out of curiosity, what was the quine you found ? – FliiFe 2 days ago
    
I had K"K2:K@Kg`Z`Z++NKN":K@Kg`Z`Z++NKN. – Steven H. yesterday

Vim, 22 bytes, Cracked!

pit^[^[p00tqqqq^V"ltxltx"

The ^[ are the literal escape key, and ^V is Ctrl-V, and are therefore counted as one byte, and are kept together in the scrambled code.

share|improve this answer
1  
Cracked! – DrMcMoylex Nov 11 at 20:17

Python 2, 54 bytes, Cracked!

=l`;lrt,]l n`p,i=,' 1,1'lnt[ll[;,0  ]['r[`][`0'ipll] ]
share|improve this answer
    
Cracked – FliiFe Nov 12 at 14:20

JavaScript, 147 bytes, Cracked by ETHProductions

I'll be very impressed if someone manages to crack this...

   """"''''((((()))))+++++++++.//99;;;;;;=========>>[[[[[]]]]]``````````````cccdddddddeeeeeeeeeeeffiiiiiiinnnnnnnoooooooorrrrrrrrsttttuuwwwwwwx{{}}

Intended solution:

e=o=>{n=o;``[r=`constructor`][r](`return e=>{`+o+`}`)````};d=e+"";e`for(i in window)if(/ert/.exec(i))w=window[i];w('e='+d+';d=e+"";e'+d[9]+n+d[9])`
share|improve this answer
    
Wow, just wow... – ETHproductions Nov 12 at 19:41
    
@ETHproductions Yeah, there's no l for alert or console.log, no m for confirm or prompt... Yeah I'm evil >:D Should I award a bounty to the cracker? – jrich Nov 12 at 19:44
    
Well, there's this function that returns rather than alerting (and I'm pretty sure the OP's version worked like that to), and I could easily do the same to your solution... but is that legal? – ETHproductions Nov 12 at 19:45
    
@ETHproductions that would totally ruin it :( I'm going to say no, but if popular opinion dictates otherwise I guess that breaks most JS challenges – jrich Nov 12 at 19:48
    
Yeah, I don't like return-quines, but I'm 99% sure there's no other way to crack that particular solution. I'll try to get a valid crack for yours though :) – ETHproductions Nov 12 at 19:49

Haskell, 86 bytes, cracked by nimi

putStr$"Study:ric====>>>>yummy:candy:circus:party:in:syrirrr!!!!!!$[;['=['[$]']='];]$"

This a valid Haskell expression which prints:

Study:ric====>>>>yummy:candy:circus:party:in:syrirrr!!!!!!$[;['=['[$]']='];]$

So if Ric studies, he can go to the yummy candy circus party! That is, if he figures out where Syrirrr is.

share|improve this answer
1  
my guess – nimi Nov 13 at 22:18

V, 20 bytes -- Safe!

"$033lpqxx|áäéééñññ

Note the trailing newline.

I wasn't really sure how to scramble them, so I just sorted the characters by ASCII value.

Unlike most V answers, this one contains zero unprintable characters. Here is a hexdump:

0000000: 2224 3033 336c 7071 7878 7ce1 e4e9 e9e9  "$033lpqxx|.....
0000010: f1f1 f10a                                ....

Unscrambled code:

éññ3äl0éé$áx3|"qpñx

Try it online!

Side not about this link. In previous versions of V, a newline was always automatically printed, which is why this version has the trailing newline. The interpreter at the time I wrote this was a valid quine, although now you can just remove the newline to make it valid.

Explanation:

éñ                      " Insert a 'ñ' character
  ñ              ñ      " Put all of the following into register 'q' and run it when it's done recording
   3äl                  " Make 3 copies of the character under the cursor
      0                 " Move to the first column
       éé               " Insert an 'é' character
         $              " Move to the last column
          áx            " Append an 'x'
            3|          " Move to the third column
              "qp       " Paste register 'q' (all of the commands we just ran)
                  x     " Delete a character
share|improve this answer

Haskell, 99 bytes, Safe

"super.quine?"=>#$$$%%%%%&&(())))**++++,,,,/;<<==>>STaabbdeffggghhhjlmmnoppqqrrsssttttuuuvvwwwwxxxx

Another Haskell quine, this time with a nice odd 99 bytes.

g%w=(g< $ >w)++w++pure(g.last$w);main=putStr$pred%"h&x>)h=%?x*,,x,,qvsf)h/mbtu%x*qvuTus%qsfe&#"
Try it on Ideone. The spaces in "g< $ >w" must be removed, I put them there because otherwise the <,$, and > vanish (most likely being interpreted as html tag). The gibberish string is a string of the program with each char mapped to it's successor, including a final " (which is possible to include into the string without escaping because it's mapped to #). The helper function % takes the string and maps each char to it's predecessor using pred (yielding code"), then appends the original string (yielding code"gibberish_code) and the last char of the decoded string (yielding code"gibberish_code"). To convert a char c to a string it would normally suffice to put it into a list [c] as strings in Haskell are simply char lists, however the successor of [ is \, which would need escaping in the successor-encoded string, so instead pure is used which lifts arbitrary types into a Monad (which Monad to use is inferred from the context).

share|improve this answer
    
Almost there. I have an additional space and !, but don't know how to get rid of it. Nice idea, have a +1. – nimi Nov 17 at 15:25
    
@nimi Tahnks, I'm curious what your approach did differently. – Laikoni 3 hours ago
    
I had g%w=g w++w++pure(last.g$w);main=putStr$(pred<$>)%"...#". So basically I failed to move the <$> into the function %. Now that I see your solution it's obvious. – nimi 2 hours ago

PHP, 110 bytes, Cracked

php$=))$)<9 php .(().)'heroes ?  $0(9carrot3?$;<.()trash3,.((3=)catarrh$$9 (,'9cry(3);  ;;tryccchhhrrrrxxxxxx
share|improve this answer
    
You have a carrot! – Kritixi Lithos Nov 11 at 18:35
1  
"... just for one day" – Luis Mendo Nov 11 at 18:43
    
Cracked. – user59178 Nov 15 at 9:31

Javascript ES6, 49 bytes (cracked)

{{$((((((('`fuck rent =+> turn off fin`')))))))}}

Is it bad if I focused more on forming coherent words in the scrambled solution?

In any case, this is my first Cops and Robbers challenge.

Update: see comments for cracked code.

share|improve this answer
2  
Cracked. – ETHproductions Nov 12 at 19:10

FurryScript, 199 bytes, Safe!

UT  TTEDU DT   T U T D   ES DGT GEL L   GL
-<<<<<<+++++++[[[[#BESTQUINEEVER!#BESTQUINEEVER!#BESTQUINEEVER!#BESTQUINEEVER!#BESTQUINEEVER!#]]]]+++++++>>>>>>-

X   XG WPW   SS  X  PW S US WWTLWP  XS  PE

Should be fairly easy to crack.

Unscrambled Code

BESTQUINE[ DUP LT +SW +GT +< BESTQUINE#> ]
EVER![ DUP EX+ SW EX- LT +SW +GT +< EVER!#> ]
<BESTQUINE[ DUP LT +SW +GT +< BESTQUINE#> ]> BESTQUINE#
<EVER![ DUP EX+ SW EX- LT +SW +GT +< EVER!#> ]> EVER!#

Just the regular quine, but with two subroutines and some more code to swap the strings.

share|improve this answer

><>, 36 bytes, Cracked!

!!!'''***+...00002333:::;???dddforrr
share|improve this answer
    
Cracked. – Martin Ender Nov 13 at 17:03

Befunge-93, 15 bytes, Cracked!

:::@#%+-_,<910g

Try it online!

share|improve this answer
    
Cracked. It's somewhat questionable though whether a quine based solely on g counts as a proper quine. – Martin Ender Nov 13 at 19:45
    
@MartinEnder That's been considered a valid form of quine in Befunge for close to 20 years now. But if you really don't like it, I've added another answer that doesn't use the g command. – James Holderness 2 days ago
    
I'm aware that this is a standard quining technique for Befunge, but as far as the rules of this community is concerned, the linked meta post is the accepted guideline for what counts as a quine. – Martin Ender 2 days ago

Python 2, 105 bytes, Cracked!

    ######%%%%''(((((((())))))))****--0011::::;;==@@@@@@@@@@[[[[]]]]aaaaaaggggggiiiiiiiinnpprrrrrrrrrtt~~

The other one was cracked, so this one is more difficult.

print'To find the solution, get to work!'

share|improve this answer
    
Cracked? – Sp3000 Nov 14 at 15:12
    
@Sp3000 Oh gosh yeah, but I actually had an original quine doing something more than that. Anyways, you did it the lazy way :P – Erik the Golfer Nov 14 at 15:14

Ruby, 53 bytes - Cracked

**TEN sTupID,sTupID NET,"TIN"<22"DEN"<<It<DEtINDE\n\n

The \n are literal newlines.

share|improve this answer
    
Cracked. – Martin Ender Nov 16 at 20:26

QB64, 89 bytes

(_+cad:effecs:fact), =+cred:scarf:attaccd?, =+eff4c3d:cars:craccd?, (_+csc:f4c3d:fact), "

Some salient points:

  • The code will not work in QBasic: it uses QB64-specific features
  • Syntax expansion is off
  • No dollar signs and only one quotation mark
  • "Poetry" would be a stretch, but it does rhyme
share|improve this answer

Befunge-93, 24 bytes

I'm afraid this is a bit late, but I wanted to attempt one without the g command.

<<_:@00278899p,**++###>!

Try it online!

share|improve this answer

OIL, 77 bytes

0
0
1
1
1
1
1
1
1
1
1
2
2
4
4
4
6
8
10
11
11
11
12
17
18
18
18
18
22
26
26
32

Good luck with that.

share|improve this answer

Jelly, 3 bytes, Cracked!

Ṙ”Ṙ

Try it online!

Here is the solution:

What, you want the solution? Find it!

share|improve this answer
    
Cracked... – Martin Ender Nov 13 at 15:42
    
@MartinEnder Of course!! I didn't except this to last for 1 minute at all, though. And I expected Dennis to do it first, but nevermind. – Erik the Golfer Nov 13 at 15:44
    
To downvoters: This just had to be posted. – Erik the Golfer Nov 17 at 8:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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