# Quine Anagrams! (Cops' Thread)

• 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 _%%%_'


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

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>

• Closely related. (Same challenge except that answers didn't have to be quines.) Nov 11, 2016 at 17:54
• 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, 2016 at 18:57
• @milk No, it doesn't need to be a valid program. Nov 11, 2016 at 18:59

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

# JavaScript, 1574 bytes, Safe!

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


## Here's the original source!

function Y(x){return x.charCodeAt()};
function Q(x){return String.fromCharCode(x)};
N=Array.prototype;
function B(f,g,h){return function(){
return f(g.apply(h||this,arguments));
}};
function S(f,h){return function(){
return f.apply(h||this,N.reverse.call(arguments))}}
function id(x){return x};
function format(){
args = N.slice.call(arguments);
str = args.shift(); res = []+[];
for(i = 0; i < str.length; i++){
c = function(){return str[i]};
if(B(Y,c) == 95){
res += args.shift();
} else if(S(B)(c,Y)() == 94){
res += q = B(id,Q)(34);
res += args.shift();
res += q;
} else if(Y(c()) == 39){
i++;
res += c() == ([][0]+[])[1] ? Q(10) : []+[];
} else res += c();
}
return res;
}
console.log(format(Z="function Y(x){return x.charCodeAt()};'nfunction Q(x){return String.fromCharCode(x)};'nN=Array.prototype;'nfunction B(f,g,h){return function(){'n  return f(g.apply(h||this,arguments));'n}};'nfunction S(f,h){return function(){'n  return f.apply(h||this,N.reverse.call(arguments))}}'nfunction id(x){return x};'nfunction format(){'n  args = N.slice.call(arguments);'n  str = args.shift(); res = []+[];'n  for(i = 0; i < str.length; i++){'n    c = function(){return str[i]};'n    if(B(Y,c) == 95){'n      res += args.shift();'n    } else if(S(B)(c,Y)() == 94){'n      res += q = B(id,Q)(34);'n      res += args.shift();'n      res += q;'n    } else if(Y(c()) == 39){'n      i++;'n      res += c() == ([][0]+[])[1] ? Q(10) : []+[];'n    } else res += c();'n  }'n  return res;'n}'nconsole.log(format(Z=^,Z))",Z))

• avocads cracks me up! Nov 14, 2016 at 18:45

# MATL, 20 bytes. Cracked

It'D-whoLl&w#ck'f0Gz


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

• Cracked Nov 13, 2016 at 21:01

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

• Welcome to PPCG! :) Nov 12, 2016 at 11:42
• 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 :-)
– user62131
Nov 12, 2016 at 11:46
• Cracked. Thanks, this was a fun challenge. :) Nov 13, 2016 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.

• I'm going to guess that there's a dry run * in there, and a \ as a configuration option to prevent an additional linefeed. Nov 16, 2016 at 15:52

## CJam, 39 bytes, Safe

!""$)+023345679:AEORYZZ\_bbceeffimmz  Solution: ")A!0zeZOmRZ$YeiE"_\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.

• I didn't know how to choose a permutation if I answered. Sorting is a good idea Nov 11, 2016 at 20:32

# Pyth, 38 bytes, Safe

Not quite golfed, but works.

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


Unsorted version:

K"K++@KZ:K@NZNgK2"++@KZ:K@NZNgK2

• I have a quine but it's missing two of the @ and one 2... It's so close! Nov 18, 2016 at 21:38
• Quick ! You don't have much time ! Nov 19, 2016 at 10:12
• I think it's over. I can't figure it out... :( Congrats on getting a safe solution! Nov 20, 2016 at 0:20
• There you have the solution ! Out of curiosity, what was the quine you found ? Nov 20, 2016 at 10:37
• I had K"K2:K@KgZZ++NKN":K@KgZZ++NKN. Nov 20, 2016 at 18:23

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

• Cracked! Nov 11, 2016 at 20:17

# Python 2, 54 bytes, Cracked!

=l;lrt,]l np,i=,' 1,1'lnt[ll[;,0  ]['r[][0'ipll] ]

• Cracked Nov 12, 2016 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+"";efor(i in window)if(/ert/.exec(i))w=window[i];w('e='+d+';d=e+"";e'+d[9]+n+d[9])

• @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? Nov 12, 2016 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? Nov 12, 2016 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 Nov 12, 2016 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 :) Nov 12, 2016 at 19:49
• @ETHproductions I may have made it a liiiiiiitle too hard in hindsight, but good luck! Nov 12, 2016 at 19:50

# 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. • my guess – nimi Nov 13, 2016 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  # 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.lastw);main=putStrpred%"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). • 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, 2016 at 15:25 • @nimi Tahnks, I'm curious what your approach did differently. Nov 22, 2016 at 13:21 • I had g%w=g w++w++pure(last.gw);main=putStr(pred<>)%"...#". So basically I failed to move the <> into the function %. Now that I see your solution it's obvious. – nimi Nov 22, 2016 at 13:30 # PHP, 110 bytes, Cracked php=)))<9 php .(().)'heroes ? 0(9carrot3?;<.()trash3,.((3=)catarrh$$9 (,'9cry(3); ;;tryccchhhrrrrxxxxxx  • You have a carrot! Nov 11, 2016 at 18:35 • "... just for one day" Nov 11, 2016 at 18:43 • Cracked. Nov 15, 2016 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.

• Nov 12, 2016 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.

# Vim, 17 bytes

<CR>""&(())::::\npps


The <CR> is Enter (^M or ^J) in the input and an added newline in the output. It is not the implicit end of file newline (see :help 'eol'). The 17 bytes are what is added to an empty buffer. (Newlines in a text editor are weird; let me know if this isn't clear.)

# ><>, 36 bytes, Cracked!

!!!'''***+...00002333:::;???dddforrr

• Cracked. Nov 13, 2016 at 17:03

# Befunge-93, 15 bytes, Cracked!

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


Try it online!

• Cracked. It's somewhat questionable though whether a quine based solely on g counts as a proper quine. Nov 13, 2016 at 19:45
• 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. Nov 19, 2016 at 19:36

# 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!'

• Nov 14, 2016 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 Nov 14, 2016 at 15:14

## Ruby, 53 bytes - Cracked

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


The \n are literal newlines.

• Cracked. Nov 16, 2016 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

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

# OIL, 77 bytes, Safe

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.

Solution, "commented" (remove comments before running or it won't work):

0 # nop twice
0
1 # copy element from cell 1 to 1 (so do nothing again)
1
1
4 # print what's in cell 1 (a zero)
1
11 # print a newline
4 # and the same thing again; printing zero and a newline
1
11
1 # copy what's in cell 2 (a 1) into cell 2
2
2
1 # copy what's in cell 12 (two lines before; a 2) into cell 18
12
18
10 # check if the value in the cell of the following line (starting with 2; we'll jump back here)
18 # (this is cell 18)
1 # is equal-ish to the one in cell 1 (a zero)
32 # if yes, jump somewhere
22 # otherwise jump one cell ahead
1 # copy what's currently in cell 18 (first a 2) into cell 26
18
26
4 # print cell 26
26
8 # increment cell 18
18
11 # print a newline
6 # and jump back to cell 17
17


So to summarize, it works by first printing two zeros, and then comparing every line starting with the third one with zero, and if it isn't zero, printing it, else exiting (since OIL reads zero from any empty/non-existent cell). Any variable lines contain the value they have when they are printed (since I'm lazy, I obtained this by first making a near-quine where those cells have some arbitrary non-zero value, and using the result, which is a quine).

# Jelly, 3 bytes, Cracked!

Ṙ”Ṙ


Try it online!

Here is the solution:

What, you want the solution? Find it!

• Cracked... Nov 13, 2016 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. Nov 13, 2016 at 15:44
• To downvoters: This just had to be posted. Nov 17, 2016 at 8:33