It's Anagram Quine, not just Quine!

10

1

The Task

In this challenge, your task is to write a program, which takes in no input, with as many anagrams that are quine of themselves as possible.

Your score will be the number of anagrams of your program's source code that are valid quines divided by the total number of anagrams possible, i.e. the percentage of the anagrams that are valid quines.

Standard Loopholes and rules of standard quines apply.

Note: Your program must have at least 3 characters (not 3 bytes).


Input

Each anagram (or permutation) of your program which is quine of itself (i.e. the anagrams which you are including in your score) must not take any input. If your language requires input as a necessity, then you can assume that your program will be given a String consisting of the lowercase letter A. However, you must not make any use of the input in any way.


Output

n number of distinct anagrams of your program's source-code must be valid quines, where n represents the number of those anagrams that you are including in your score, i.e.

Math Equation

Those quine-anagarams can output in any way except writing the output to a variable. Writing to file, console, screen etc. is allowed. Function return is allowed as well.


Scoring Example

Suppose your program's source code is code. And,

  1. code outputs code.
  2. coed outputs coed.
  3. cdoe outputs cdoe.
  4. cdeo outputs cdeo.
  5. cedo outputs cedo.
  6. ceod outputs ceod.
  7. ocde outputs ocde.
  8. oced outputs oced.
  9. odce outputs odce.
  10. odec does not output odec or produces error.
  11. oedc does not output oedc or produces error.
  12. oecd does not output oecd or produces error.
  13. doce does not output doce or produces error.
  14. doec does not output doec or produces error.
  15. dcoe does not output dcoe or produces error.
  16. dceo does not output deco or produces error.
  17. deco does not output deco or produces error.
  18. deoc does not output deoc or produces error.
  19. eodc does not output eodc or produces error.
  20. eocd does not output eocd or produces error.
  21. edoc does not output edoc or produces error.
  22. edco does not output edco or produces error.
  23. ecdo does not output ecdo or produces error.
  24. ecod does not output ecod or produces error.

The score of this solution will be

Math Equation


Winning Criterion

The solution with the highest score wins! In case of a tie, the answer with higher char-count (not byte-count) wins (hence the )! If a tie still persists, then the solution which was posted earlier wins!

Arjun

Posted 2017-05-21T07:36:25.730

Reputation: 4 544

I believe this is a duplicate of https://codegolf.stackexchange.com/questions/121522/rotation-safe-quine

– Neil A. – 2017-05-21T08:01:14.213

@NeilA. I'm a lot more confident that a rotation-safe quine can actually be written in other languages than Unary (although not in many languages and it will still be hard). – Martin Ender – 2017-05-21T08:12:31.243

It's probably too late to change the specs now, but you should probably have specified that the original program doesn't count, because otherwise this essentially seems to be a duplicate of our vanilla quine question. – SuperJedi224 – 2017-05-23T01:50:16.743

Answers

7

Unary, 100%

This is essentially the same as the Lenguage answer because of how the two are related. I think it's worth noting, though. I scored it as 100% because every permutation of the code will result in a quine of itself and I see that as X/X * 100 = 100%.

5.71728886e+3431 zeroes. The full number can be found in this snippet:

571,728,886,299,524,079,667,110,831,585,172,705,903,242,988,869,730,233,666,941,239,930,957,383,634,990,884,017,758,011,673,661,456,375,420,014,789,453,910,279,412,516,365,039,911,616,569,776,194,653,994,845,706,814,330,810,597,741,840,830,026,333,447,578,878,492,702,908,613,882,908,168,867,637,282,596,648,914,407,902,821,648,635,054,942,485,156,519,086,239,517,305,702,705,783,520,430,327,882,724,649,323,623,993,252,952,774,346,675,694,385,891,810,563,667,798,834,846,369,950,692,136,274,353,903,969,878,343,229,031,870,459,050,270,140,433,402,333,183,995,076,273,934,316,316,041,923,055,208,568,854,697,194,015,046,079,301,420,468,901,769,118,098,230,767,460,924,846,552,476,679,293,134,684,448,847,449,288,151,944,932,525,087,248,192,275,095,934,337,598,653,981,534,386,220,451,824,875,829,915,842,538,357,082,913,137,430,485,883,178,947,004,702,124,084,633,123,544,060,730,650,995,512,745,030,590,989,195,409,454,379,726,020,068,090,543,485,377,485,846,396,271,958,108,709,617,635,354,477,293,970,464,272,097,575,501,779,386,668,756,938,340,200,794,894,015,824,708,091,428,944,573,831,257,244,094,409,870,775,301,993,104,432,870,895,478,408,037,450,837,230,273,086,589,639,225,269,690,034,191,664,788,952,560,282,035,550,980,217,998,364,096,267,637,012,870,557,015,775,372,943,770,232,826,937,792,678,659,741,977,391,285,036,126,978,266,614,181,473,074,907,458,591,514,305,961,253,806,814,023,933,864,985,407,267,169,604,856,107,931,116,888,268,748,039,451,683,353,551,414,447,462,928,850,923,445,503,652,021,793,168,648,510,513,597,305,336,955,173,718,471,931,736,313,986,020,652,567,023,366,257,316,037,210,037,318,158,858,503,724,736,280,981,391,398,280,363,850,853,361,932,459,586,164,155,418,666,917,331,478,035,204,211,067,642,357,524,068,995,687,396,230,593,421,768,310,516,964,395,591,974,018,305,173,396,770,508,740,001,527,520,092,344,197,005,623,355,537,596,657,473,766,544,801,370,212,627,256,410,732,664,011,822,421,191,103,127,619,073,582,845,123,484,719,578,718,376,300,070,162,355,969,718,786,766,544,705,666,866,547,241,576,008,751,585,319,953,584,072,266,931,915,765,118,041,170,749,844,694,686,800,072,822,536,450,477,293,767,227,280,278,303,598,479,313,816,303,539,184,630,996,668,979,230,004,925,749,414,158,627,159,671,600,379,023,203,894,575,932,729,998,748,035,419,783,450,180,418,397,923,824,642,227,478,374,530,825,875,117,414,862,969,170,359,605,774,864,660,165,183,532,258,493,867,754,625,154,388,052,741,695,648,070,594,472,531,159,793,952,847,078,816,841,601,345,611,759,202,959,380,748,999,978,577,549,942,317,774,738,570,775,404,426,481,919,733,186,968,468,431,270,431,605,972,498,637,946,956,126,022,229,614,797,087,117,225,823,565,342,748,501,153,741,450,722,494,697,466,495,557,622,414,355,168,111,360,033,562,039,346,636,733,121,121,610,857,454,876,606,487,443,794,811,222,591,756,267,144,914,006,412,918,432,311,781,300,777,103,610,374,114,091,997,695,742,108,877,002,082,862,282,098,075,681,749,979,978,446,425,489,037,395,541,763,956,873,201,738,020,809,689,085,082,333,652,677,837,122,632,903,083,224,964,125,736,624,491,672,540,404,024,051,399,430,701,347,505,739,704,581,760,444,853,708,889,328,730,053,965,944,499,104,791,856,210,999,740,898,398,825,918,657,619,888,095,865,548,102,735,913,913,094,386,735,714,696,418,726,741,576,678,447,905,375,266,819,534,780,270,705,492,733,528,843,064,273,668,310,355,948,806,085,914,998,909,078,430,123,434,842,644,353,766,593,108,209,757,731,578,915,664,389,676,321,477,765,937,156,616,387,196,395,610,946,243,206,146,663,560,610,797,140,874,906,254,178,018,061,181,083,047,209,661,789,909,286,724,851,898,477,573,800,702,633,601,175,620,396,600,949,134,122,178,276,685,812,142,120,568,127,180,096,273,903,971,758,009,993,201,718,908,993,673,764,199,386,800,398,143,178,502,530,082,660,500,014,722,964,981,864,977,851,706,298,981,882,062,478,994,083,243,364,559,882,663,594,491,418,634,537,443,259,947,411,981,605,363,306,172,530,522,346,606,185,828,881,879,282,631,498,937,150,281,652,951,729,913,616,393,089,658,674,346,663,853,707,461,126,940,124,422,764,766,614,384,500,640,200,165,833,857,590,144,741,546,981,402,879,612,572,412,230,319,659,934,882,344,598,744,566,237,876,680,653,747,327,784,600,034,796,624,136,727,679,072,247,471,775,907,417,517,609,655,422,229,860,544,695,004,718,249,668,190,489,544,232,936,202,367,307,609,329,582,839,156,431,588,444,789,676,252,562,273,585,535,627,566,417,124,298,941,319,814,273,113,830,010,077,536,882,402,273,792,934,052,604,658,425,046,299,684,558,311,449,368,519,016,440,435,219,777,519,127,752,414,574,327,366,464,226,160,312,027,143

The Brainf*ck equivalent is in this snippet:

>+++++>++>++++++>+>+++++>+++++>+>++++++>+>+++++>+>++++++>+>+++++>+>++++++>+++>+++++>+++++>+>+++>++>+
+++>++++++>++>++++++>+++>+++++>++>++++++>++>+++++>++>++++++>+>+++++>+++++>+>++++++>+>+++++>+>++++++>
+>+++++>+>++++++>++>+++>+++++>+++++>+>+++>++>++++>++++++>++>++++++>+++>+++>+++>+++++>++>++++++>++>++
+++>++>++++++>+>++++>++++++>+>++++++>+>+++++>+>++++++>+>+++++>++++>+++++>++>+++>+>++++>++++++>+>++++
++>++>++>+++++>++>++++++>+>+++++>+++++>+++++>+>++++++>+>+++>++>++>+++++>++>++++++>+>++++>++++++>+>++
+++>+>++++++>+++>+>++++>+++++>++++>+++++>++++>+++++>++++>+++++>++++>+++++>++++>+++++>++++>++>++++>+>
+>+>+++++>+>+>+>++++++>+++>+++>+>+>+>+++>+>+>+>+++>+++++>++>++>++>++++++>+>++++++>++>+++++>++++>+>+>
+>+++++>+>+>+>++++++>+++>+++>+>+>+>+++>+++>+>+>+>+++>+++>+++++>++>++>++>++++++>++++++>+>++++++>++>++
+++>++++>+>+>+>+++++>+>+>+>++++++>+++>+++>+>+>+>+++>+++>+>+>+>+++>+++++>++>++>++>++++++>++++++>+>+++
+++>++>+++++>++++>+>+>+>+++++>+>+>+>++++++>+++>+>+>+>+++>+++>+>+>+>+++>+++>+++++>++>++>++>++++++>+++
+++>+>++++++>++>+++++>++++>+>+>+>+++++>+>+>+>++++++>+++>+>+>+>+++>+++>+>+>+>+++>+++++>++>++>++>+++++
+>++++++>+>++++++>++>+++++>++++>+>+>+>+++++>+>+>+>++++++>+++>+>+>+>+++>+>+>+>+++>+++>+++++>++>++>++>
++++++>++++++>+>++++++>++>+++++>++++>+>+>+>+++++>+>+>+>++++++>+++>+>+>+>+++>+>+>+>+++>+++++>++>++>++
>++++++>++++++>++>+++++>++>++++++>+>++++++>+++>+++>++>+++>+++++>++>+++>+>+>+++++>+++++>+>+++>+>+++>+
+>++>++++>++++++>+>+++++>++>+++>+>++++>++++++>+>++++>+++++>++++>+++++>++++>+>+++++>+>+++>+>+++>++>++
>++++>++++++>+>+++++>++>+++>+>++++>++++++>+>+++++>++>+++>+>++++>+++++>++>++++>+>+++++>++++>++++++>++
++++>++++++>++>+++++>++++>++>++++>+>+>+>+++++>+>+>+>++++++>++>++>++>+++++>+++++>+>+>+>+++>++>++>++>+
+++>++++++>++>++>++>++++++>+>+>+>+++>+++>+++>++>++>++>+++>+++>+++>++>++>++>++++>++++>++++>++>++>++>+
++++>++>++>++>++++++>+>++++>+>+>+++++>+>+>+>++++++>+++>+++++>+>+>+>++++++>+>++++++>++>++>++++++>++++
++>+>++++++>++>++>++>+++++>++>++>++>++++++>+>+++++>++>++>+++>+>+++>+>++++>++++++>++>++>+++++>+>+>+++
>++>++>++++>++++++>+>+++++>++++>+>+>+>+++++>+++++>+>+++>+>+++>++>++>++++>++++++>+>+++++>++>+++>+>+++
+>++++++>+>++++>+++++>++>+++>+>++++>+++++>++>++++>+>++++>++++++>++>+++++>++++>++>++++>++++>+>+>+>+++
++>+>+>+>++++++>++>++>++>+++++>+++++>+>+>+>+++>++>++>++>++++>++++++>++>++>++>++++++>+>+>+>+++>+++>++
+>++>++>++>++>++>++>+++++>++>++>++>++++++>+>++++>+>+>+++++>+>+>+>++++++>+++>+++++>+>+>+>++++++>++>++
>++++++>+>++++++>+>++++++>++>++>++>+++++>++>++>++>++++++>++++++>+>+++++>++>++>+++>+>+++>+>++++>+++++
+>++>++>+++++>+>+>+++>++>++>++++>++++++>+>+++++>++++>+>+>+>+++++>+++++>+>+++>+>+++>++>++>++++>++++++
>+>+++++>++>+++>+>++++>++++++>+++>+>++++>+++++>++>++++>+>+++++>++++>++++++>++++++>++>+++++>++++>++>+
+++>++>++>++>+++++>++>++>++>++++++>+>++++>+>+>+++++>+>+>+>++++++>+>+>+>+++++>+++++>++>++>++>+++>+>+>
+>++++>++++++>+>+>+>++++++>++>++>++>++>++>++++++>+>+>++++++>++>++>++>+++++>++>++>++>++++++>++++++>+>
+++++>+>++++>++>++++>++++++>+>++++++>+>+++++>+++>+++>+++>+++++>+>+++>+++>+++>+++>+++>+++>+++>+++>++>
++++>++++++>+>+++++++>+>+>++++++[<]>[[>]>[>]>[>]+[[>+<-]<]+[<]<[<]>[[>]>[>]>[>]<+[[>+<-]<]+++[<]<[<]
>-]>]>[>]>[-[<+>-]>]<<[<]>[[[>]>+<<[<]>-]>[>]+>-[-[-[-[-[-[-<->>>[>>>]++>>>+>>>+[<<<]>]<[->>>[>>>]++
>>>++>>>++[<<<]]>]<[->>>[>>>]++>>>++>>>+[<<<]]>]<[->>>[>>>]+>>>++>>>++[<<<]]>]<[->>>[>>>]+>>>++>>>+[
<<<]]>]<[->>>[>>>]+>>>+>>>++[<<<]]>]<[->>>[>>>]+>>>+>>>+[<<<]]<[<]>]++
%
<+[<+>>[[>+>+<<-]>[<+>-]>-[-[->[>+>+<<-]>[<+>-]>[<+>-[<->[-]]]<[-<->>>[>>>]<<<[[>>>+<<<-]<<<]>>>+++<
<<+++<<<---<<<[<<<]>->>[>>>]+[>>>]>]<<]]>]<<<[<<<]>[<<+>+>-]<<[>>+<<-]>[->>>[[>+>+<<-]>[<+>-]>-[<+>-
[<->-]<[-<-->>>[>>>]<<<[[>>>+<<<-]<<<]>>>+++<<<<<<[<<<]>->>[>>>]+[>>>]<<]>]>]<<<[<<<]]>[<<+>+>-]<<[>
>+<<-]>[->>>[[>+>+<<-]>[<+>-]+>-[<->[-]]<[-<-<<<[<<<]>->>[>>>]>>>[[<<<+>>>-]>>>]<<<<<]>>]<<<[<<<]]>[
>-<-]>]>[+++[>++++++++<-]>.>>]

Source of source

Engineer Toast

Posted 2017-05-21T07:36:25.730

Reputation: 5 769

Congratulations on winning! :) – Arjun – 2017-05-28T09:24:04.640

1@Arjun Thanks but the Legrange answer was first and has the same score. It should win, instead. – Engineer Toast – 2017-05-28T11:58:10.963

@EngineerToast I mean it doesn't matter to me, it is CW so no +15 :P – Christopher – 2017-05-28T20:04:15.303

4

Lenguage, 100%

5.71728886e+3431 null bytes. The full number can be found in this snippet:

571728886299524079667110831585172705903242988869730233666941239930957383634990884017758011673661456375420014789453910279412516365039911616569776194653994845706814330810597741840830026333447578878492702908613882908168867637282596648914407902821648635054942485156519086239517305702705783520430327882724649323623993252952774346675694385891810563667798834846369950692136274353903969878343229031870459050270140433402333183995076273934316316041923055208568854697194015046079301420468901769118098230767460924846552476679293134684448847449288151944932525087248192275095934337598653981534386220451824875829915842538357082913137430485883178947004702124084633123544060730650995512745030590989195409454379726020068090543485377485846396271958108709617635354477293970464272097575501779386668756938340200794894015824708091428944573831257244094409870775301993104432870895478408037450837230273086589639225269690034191664788952560282035550980217998364096267637012870557015775372943770232826937792678659741977391285036126978266614181473074907458591514305961253806814023933864985407267169604856107931116888268748039451683353551414447462928850923445503652021793168648510513597305336955173718471931736313986020652567023366257316037210037318158858503724736280981391398280363850853361932459586164155418666917331478035204211067642357524068995687396230593421768310516964395591974018305173396770508740001527520092344197005623355537596657473766544801370212627256410732664011822421191103127619073582845123484719578718376300070162355969718786766544705666866547241576008751585319953584072266931915765118041170749844694686800072822536450477293767227280278303598479313816303539184630996668979230004925749414158627159671600379023203894575932729998748035419783450180418397923824642227478374530825875117414862969170359605774864660165183532258493867754625154388052741695648070594472531159793952847078816841601345611759202959380748999978577549942317774738570775404426481919733186968468431270431605972498637946956126022229614797087117225823565342748501153741450722494697466495557622414355168111360033562039346636733121121610857454876606487443794811222591756267144914006412918432311781300777103610374114091997695742108877002082862282098075681749979978446425489037395541763956873201738020809689085082333652677837122632903083224964125736624491672540404024051399430701347505739704581760444853708889328730053965944499104791856210999740898398825918657619888095865548102735913913094386735714696418726741576678447905375266819534780270705492733528843064273668310355948806085914998909078430123434842644353766593108209757731578915664389676321477765937156616387196395610946243206146663560610797140874906254178018061181083047209661789909286724851898477573800702633601175620396600949134122178276685812142120568127180096273903971758009993201718908993673764199386800398143178502530082660500014722964981864977851706298981882062478994083243364559882663594491418634537443259947411981605363306172530522346606185828881879282631498937150281652951729913616393089658674346663853707461126940124422764766614384500640200165833857590144741546981402879612572412230319659934882344598744566237876680653747327784600034796624136727679072247471775907417517609655422229860544695004718249668190489544232936202367307609329582839156431588444789676252562273585535627566417124298941319814273113830010077536882402273792934052604658425046299684558311449368519016440435219777519127752414574327366464226160312027143

Christopher

Posted 2017-05-21T07:36:25.730

Reputation: 3 428

@ETHproductions fixed it. I think I win – Christopher – 2017-05-22T17:23:28.873

Would this output 5.71728886e+3431 null bytes or something else? – ETHproductions – 2017-05-22T17:24:55.953

@ETHproductions Yeah I guess. – Christopher – 2017-05-22T17:25:45.973

Made CW because I may not be around to remove this :P – Christopher – 2017-05-22T17:27:24.643

@Christopher You should include the precise amount of bytes so that this can be decoded. There is currently no way to tell what this does. – Post Rock Garf Hunter – 2017-05-22T17:30:47.003

@WheatWizard view revisions – Christopher – 2017-05-22T17:32:05.863

It would also be nice if you included the Brainfuck program that this compiles into. – Post Rock Garf Hunter – 2017-05-22T17:39:49.577

@SuperJedi224 So infinity score :D. – Christopher – 2017-05-22T18:15:41.243

@Christopher I don't think the original program should count as an anagram of itself, but I reread the OP and the OP seems to be allowing it. – SuperJedi224 – 2017-05-22T18:17:52.297

@SuperJedi224 Yeah it is unclear. But X/0 = infinity – Christopher – 2017-05-22T18:20:27.577

Why isn't the score X/X = 100% ? – Engineer Toast – 2017-05-22T18:28:34.240

Unary and Lenguage use different binary encodings of Brainfuck programs. It's unlikely the quine would work in both Unary and Lenguage. – jimmy23013 – 2017-06-13T18:09:19.137

3

Jelly, 33.333...%

”ṘṘ

Try it online!

Community wiki because I did not write this. If you like this solution, or want an explanation, see Dennis's original post here.

James

Posted 2017-05-21T07:36:25.730

Reputation: 54 537

2

Microscript II, score 1/1814399=5.5e-7

"qp1h"qp1h

"qph1"qph1 is also a quine.

Microscript II, score 5/119750399=4.2e-8

"qp12h"qp12h

"qp21h"qp21h, "qph12"qph12, "qph21"qph21, "qp1h2"qp1h2 and "qp2h1"qp2h1 are also quines.

I'm sure someone can come up with a much higher score than either of these, but this is still the only answer with at least one quine that isn't the original program (which, IMO, shouldn't be counted).

SuperJedi224

Posted 2017-05-21T07:36:25.730

Reputation: 11 342

1

V, 16.666...%

2i2i

Try it online!

There are 6 possible anagrams of this code:

2i2i
22ii
i22i
i2i2
ii22
2ii2

And one of them is a quine.

James

Posted 2017-05-21T07:36:25.730

Reputation: 54 537

I'm not sure the original program should count as an anagram of itself, but the OP seems to be allowing it. – SuperJedi224 – 2017-05-22T18:15:11.667