Quine Anagrams! (Cops' Thread)

22

2

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>

Oliver Ni

Posted 2016-11-11T17:45:04.773

Reputation: 9 650

7Closely related. (Same challenge except that answers didn't have to be quines.) – Martin Ender – 2016-11-11T17:54:39.577

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 – 2016-11-11T18:57:10.710

@milk No, it doesn't need to be a valid program. – Oliver Ni – 2016-11-11T18:59:41.397

Answers

15

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.

milk

Posted 2016-11-11T17:45:04.773

Reputation: 3 043

10

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))

Conor O'Brien

Posted 2016-11-11T17:45:04.773

Reputation: 36 228

avocads cracks me up! – user41805 – 2016-11-14T18:45:35.740

9

MATL, 20 bytes. Cracked

It'D-whoLl&w#ck'f0Gz

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

Luis Mendo

Posted 2016-11-11T17:45:04.773

Reputation: 87 464

Cracked – James Holderness – 2016-11-13T21:01:37.440

5

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.

Martin Ender

Posted 2016-11-11T17:45:04.773

Reputation: 184 808

I didn't know how to choose a permutation if I answered. Sorting is a good idea – Luis Mendo – 2016-11-11T20:32:06.917

5

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.

user62131

Posted 2016-11-11T17:45:04.773

Reputation:

Welcome to PPCG! :) – Martin Ender – 2016-11-12T11:42:33.427

2Well, 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 :-) – None – 2016-11-12T11:46:50.190

Cracked. Thanks, this was a fun challenge. :) – Martin Ender – 2016-11-13T13:13:42.120

5

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.

Martin Ender

Posted 2016-11-11T17:45:04.773

Reputation: 184 808

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 – 2016-11-16T15:52:28.043

4

Pyth, 38 bytes, Safe

Not quite golfed, but works.

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

Unsorted version:

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

FliiFe

Posted 2016-11-11T17:45:04.773

Reputation: 543

1I have a quine but it's missing two of the @ and one 2... It's so close! – Steven H. – 2016-11-18T21:38:06.080

Quick ! You don't have much time ! – FliiFe – 2016-11-19T10:12:37.607

I think it's over. I can't figure it out... :( Congrats on getting a safe solution! – Steven H. – 2016-11-20T00:20:05.383

There you have the solution ! Out of curiosity, what was the quine you found ? – FliiFe – 2016-11-20T10:37:47.013

I had K"K2:K@Kg\Z`Z++NKN":K@Kg`Z`Z++NKN`. – Steven H. – 2016-11-20T18:23:24.140

3

Python 2, 54 bytes, Cracked!

=l`;lrt,]l n`p,i=,' 1,1'lnt[ll[;,0  ]['r[`][`0'ipll] ]

Loovjo

Posted 2016-11-11T17:45:04.773

Reputation: 7 357

Cracked – FliiFe – 2016-11-12T14:20:43.420

3

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.

Loovjo

Posted 2016-11-11T17:45:04.773

Reputation: 7 357

1Cracked! – James – 2016-11-11T20:17:32.420

3

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

James

Posted 2016-11-11T17:45:04.773

Reputation: 54 537

3

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.

Laikoni

Posted 2016-11-11T17:45:04.773

Reputation: 23 676

1my guess – nimi – 2016-11-13T22:18:14.683

3

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])`

jrich

Posted 2016-11-11T17:45:04.773

Reputation: 3 898

@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 – 2016-11-12T19:44:23.953

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 – 2016-11-12T19:45:54.463

@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 – 2016-11-12T19:48:48.267

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 – 2016-11-12T19:49:41.830

@ETHproductions I may have made it a liiiiiiitle too hard in hindsight, but good luck! – jrich – 2016-11-12T19:50:29.480

Wait, is it a full program or a function that you have to call manually? – ETHproductions – 2016-11-12T19:58:56.300

@ETHproductions Full program. – jrich – 2016-11-12T19:59:40.550

Cracked :) – ETHproductions – 2016-11-12T20:04:51.373

I like the for(i in window)if(/ert/.exec(i)) trick for avoiding al. – ETHproductions – 2016-11-12T20:23:16.957

3

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

Laikoni

Posted 2016-11-11T17:45:04.773

Reputation: 23 676

Almost there. I have an additional space and !, but don't know how to get rid of it. Nice idea, have a +1. – nimi – 2016-11-17T15:25:04.810

@nimi Tahnks, I'm curious what your approach did differently. – Laikoni – 2016-11-22T13:21:22.980

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 – 2016-11-22T13:30:23.147

2

PHP, 110 bytes, Cracked

php$=))$)<9 php .(().)'heroes ?  $0(9carrot3?$;<.()trash3,.((3=)catarrh$$9 (,'9cry(3);  ;;tryccchhhrrrrxxxxxx

Oliver Ni

Posted 2016-11-11T17:45:04.773

Reputation: 9 650

You have a carrot! – user41805 – 2016-11-11T18:35:35.423

1"... just for one day" – Luis Mendo – 2016-11-11T18:43:46.823

Cracked. – user59178 – 2016-11-15T09:31:59.077

1

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

udioica

Posted 2016-11-11T17:45:04.773

Reputation: 2 381

1

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.

Mama Fun Roll

Posted 2016-11-11T17:45:04.773

Reputation: 7 234

2Cracked. – ETHproductions – 2016-11-12T19:10:32.370

1

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.

acrolith

Posted 2016-11-11T17:45:04.773

Reputation: 3 728

0

Ruby, 53 bytes - Cracked

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

The \n are literal newlines.

dkudriavtsev

Posted 2016-11-11T17:45:04.773

Reputation: 5 781

Cracked. – Martin Ender – 2016-11-16T20:26:17.010

0

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

DLosc

Posted 2016-11-11T17:45:04.773

Reputation: 21 213

0

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!

James Holderness

Posted 2016-11-11T17:45:04.773

Reputation: 8 298

0

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

L3viathan

Posted 2016-11-11T17:45:04.773

Reputation: 3 151

0

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

Erik the Outgolfer

Posted 2016-11-11T17:45:04.773

Reputation: 38 134

Cracked? – Sp3000 – 2016-11-14T15:12:19.703

@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 Outgolfer – 2016-11-14T15:14:21.353

0

><>, 36 bytes, Cracked!

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

Erik the Outgolfer

Posted 2016-11-11T17:45:04.773

Reputation: 38 134

Cracked. – Martin Ender – 2016-11-13T17:03:25.577

0

Befunge-93, 15 bytes, Cracked!

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

Try it online!

James Holderness

Posted 2016-11-11T17:45:04.773

Reputation: 8 298

Cracked. It's somewhat questionable though whether a quine based solely on g counts as a proper quine. – Martin Ender – 2016-11-13T19:45:48.147

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 – 2016-11-19T19:36:05.983

-2

Jelly, 3 bytes, Cracked!

Ṙ”Ṙ

Try it online!

Here is the solution:

What, you want the solution? Find it!

Erik the Outgolfer

Posted 2016-11-11T17:45:04.773

Reputation: 38 134

Cracked... – Martin Ender – 2016-11-13T15:42:50.523

@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 Outgolfer – 2016-11-13T15:44:12.980

To downvoters: This just had to be posted. – Erik the Outgolfer – 2016-11-17T08:33:03.563