244
\$\begingroup\$

Using your language of choice, golf a quine.

A quine is a non-empty computer program which takes no input and produces a copy of its own source code as its only output.

No cheating -- that means that you can't just read the source file and print it. Also, in many languages, an empty file is also a quine: that isn't considered a legit quine either.

No error quines -- there is already a separate challenge for error quines.

Points for:

  • Smallest code (in bytes)
  • Most obfuscated/obscure solution
  • Using esoteric/obscure languages
  • Successfully using languages that are difficult to golf in

The following Stack Snippet can be used to get a quick view of the current score in each language, and thus to know which languages have existing answers and what sort of target you have to beat:

var QUESTION_ID=69;
var OVERRIDE_USER=98;

var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";var COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk";var answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;function answersUrl(index){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+index+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}
function commentUrl(index,answers){return"https://api.stackexchange.com/2.2/answers/"+answers.join(';')+"/comments?page="+index+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}
function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(data){answers.push.apply(answers,data.items);answers_hash=[];answer_ids=[];data.items.forEach(function(a){a.comments=[];var id=+a.share_link.match(/\d+/);answer_ids.push(id);answers_hash[id]=a});if(!data.has_more)more_answers=!1;comment_page=1;getComments()}})}
function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(data){data.items.forEach(function(c){if(c.owner.user_id===OVERRIDE_USER)
answers_hash[c.post_id].comments.push(c)});if(data.has_more)getComments();else if(more_answers)getAnswers();else process()}})}
getAnswers();var SCORE_REG=(function(){var headerTag=String.raw `h\d`
var score=String.raw `\-?\d+\.?\d*`
var normalText=String.raw `[^\n<>]*`
var strikethrough=String.raw `<s>${normalText}</s>|<strike>${normalText}</strike>|<del>${normalText}</del>`
var noDigitText=String.raw `[^\n\d<>]*`
var htmlTag=String.raw `<[^\n<>]+>`
return new RegExp(String.raw `<${headerTag}>`+String.raw `\s*([^\n,]*[^\s,]),.*?`+String.raw `(${score})`+String.raw `(?=`+String.raw `${noDigitText}`+String.raw `(?:(?:${strikethrough}|${htmlTag})${noDigitText})*`+String.raw `</${headerTag}>`+String.raw `)`)})();var OVERRIDE_REG=/^Override\s*header:\s*/i;function getAuthorName(a){return a.owner.display_name}
function process(){var valid=[];answers.forEach(function(a){var body=a.body;a.comments.forEach(function(c){if(OVERRIDE_REG.test(c.body))
body='<h1>'+c.body.replace(OVERRIDE_REG,'')+'</h1>'});var match=body.match(SCORE_REG);if(match)
valid.push({user:getAuthorName(a),size:+match[2],language:match[1],link:a.share_link,})});valid.sort(function(a,b){var aB=a.size,bB=b.size;return aB-bB});var languages={};var place=1;var lastSize=null;var lastPlace=1;valid.forEach(function(a){if(a.size!=lastSize)
lastPlace=place;lastSize=a.size;++place;var answer=jQuery("#answer-template").html();answer=answer.replace("{{PLACE}}",lastPlace+".").replace("{{NAME}}",a.user).replace("{{LANGUAGE}}",a.language).replace("{{SIZE}}",a.size).replace("{{LINK}}",a.link);answer=jQuery(answer);jQuery("#answers").append(answer);var lang=a.language;lang=jQuery('<i>'+a.language+'</i>').text().toLowerCase();languages[lang]=languages[lang]||{lang:a.language,user:a.user,size:a.size,link:a.link,uniq:lang}});var langs=[];for(var lang in languages)
if(languages.hasOwnProperty(lang))
langs.push(languages[lang]);langs.sort(function(a,b){if(a.uniq>b.uniq)return 1;if(a.uniq<b.uniq)return-1;return 0});for(var i=0;i<langs.length;++i)
{var language=jQuery("#language-template").html();var lang=langs[i];language=language.replace("{{LANGUAGE}}",lang.lang).replace("{{NAME}}",lang.user).replace("{{SIZE}}",lang.size).replace("{{LINK}}",lang.link);language=jQuery(language);jQuery("#languages").append(language)}}
body{text-align:left!important}#answer-list{padding:10px;float:left}#language-list{padding:10px;float:left}table thead{font-weight:700}table td{padding:5px}
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="https://cdn.sstatic.net/Sites/codegolf/primary.css?v=f52df912b654"> <div id="language-list"> <h2>Winners by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr></thead> <tbody id="languages"> </tbody> </table> </div><div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr></thead> <tbody id="answers"> </tbody> </table> </div><table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td><a href="{{LINK}}">{{SIZE}}</a></td></tr></tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td><a href="{{LINK}}">{{SIZE}}</a></td></tr></tbody> </table> 

\$\endgroup\$
3
  • 6
    \$\begingroup\$ Do you not mean, "Golf you a quine for greater good!"? \$\endgroup\$ May 3, 2011 at 2:49
  • 64
    \$\begingroup\$ @muntoo it's a play on "Learn you a Haskell for Great Good". \$\endgroup\$ May 3, 2011 at 2:52
  • 26
    \$\begingroup\$ Did anybody notice that this is question 69? \$\endgroup\$
    – aidan0626
    Oct 24, 2020 at 22:47

455 Answers 455

1
\$\begingroup\$

Bash, 54 52 bytes

-2 thanks to Ørjan Johansen

a=\' b='a=\\$a b=$a$b$a\;eval echo \$b';eval echo $b
\$\endgroup\$
4
  • \$\begingroup\$ The spaces after the semicolons seem unnecessary. \$\endgroup\$ May 27, 2017 at 2:06
  • \$\begingroup\$ @ØrjanJohansen Oh, I completely forgot to golf that part! Thanks :D \$\endgroup\$
    – MD XF
    May 27, 2017 at 2:27
  • \$\begingroup\$ You forgot to include the new length. \$\endgroup\$ May 27, 2017 at 2:39
  • \$\begingroup\$ @ØrjanJohansen Is there any limit to how helpful you can be :P \$\endgroup\$
    – MD XF
    May 27, 2017 at 2:40
1
\$\begingroup\$

><>, 42 Bytes

'r3d*>l?\ao"/o \     "ooooooooo;
     \ o/

Try it online

\$\endgroup\$
1
\$\begingroup\$

shortC, 38 28 bytes

AR_="AR_=%c%s%1$c,34,_",34,_

Try it online!

\$\endgroup\$
1
\$\begingroup\$

ABAP, 515 bytes

REPORT R NO STANDARD PAGE HEADING.DATA:A TYPE TABLE OF STRING,B(8).APPEND:
`REPORT.FORM F TABLES T.NEW-PAGE LINE-SIZE 78.WRITE:'REPORT R NO',` TO A,
`'STANDARD PAGE HEADING.DATA:A TYPE TABLE OF STRING,B(8).APPEND:'.LOOP` TO A,
`AT T.REPLACE ALL OCCURENCES OF'``' IN T WITH'````'.WRITE:/'``'` TO A,
`NO-GAP,T NO-GAP,'`` TO A,'.ENDLOOP.WRITE:AT 78'.','GENERATE',` TO A,
`'SUBROUTINE POOL A NAME B.PERFORM F IN PROGRAM (B) TABLES A.'.ENDFORM.` TO A.
GENERATE SUBROUTINE POOL A NAME B.PERFORM F IN PROGRAM (B) TABLES A.

Should work on on any SAP system with SY-SAPRL >= '700'.

source

\$\endgroup\$
3
  • \$\begingroup\$ is this an error quine? \$\endgroup\$ May 24, 2017 at 23:53
  • \$\begingroup\$ @DestructibleLemon No, why do you ask? \$\endgroup\$
    – MD XF
    May 25, 2017 at 0:46
  • \$\begingroup\$ Anyone care to explain the serial downvoting? \$\endgroup\$
    – MD XF
    May 25, 2017 at 17:20
1
\$\begingroup\$

Bob, 1221 bytes

c=","; n="\n"; q="\""; s="\\";
v=\[
"c=\",\"; n=\"\\n\"; q=\"\\\"\"; s=\"\\\\\";",
"v=\\[",
"define prtQuote(str) {",
" local j,t,v;",
" stdout.Display(q);",
" for (j=0; j<str.size; j++) {",
"  t = str.Substring(j,1);",
"  if (t==q) { stdout.Display(s); }",
"  if (t==s) { stdout.Display(s); }",
"  stdout.Display(t);",
" }",
" stdout.Display(q);",
"}",
"for(i=0; i<2; i++){ stdout.Display(v[i]); stdout.Display(n); }",
"for(i=0; i<v.size-1; i++){ prtQuote(v[i]); stdout.Display(c); stdout.Display(n); }",
"prtQuote(v[v.size-1]); stdout.Display(n);",
"stdout.Display(v[v.size-1]); stdout.Display(n);",
"for(i=2; i<v.size-1; i++){ stdout.Display(v[i]); stdout.Display(n); }",
"];"
];
define prtQuote(str) {
 local j,t,v;
 stdout.Display(q);
 for (j=0; j<str.size; j++) {
  t = str.Substring(j,1);
  if (t==q) { stdout.Display(s); }
  if (t==s) { stdout.Display(s); }
  stdout.Display(t);
 }
 stdout.Display(q);
}
for(i=0; i<2; i++){ stdout.Display(v[i]); stdout.Display(n); }
for(i=0; i<v.size-1; i++){ prtQuote(v[i]); stdout.Display(c); stdout.Display(n); }
prtQuote(v[v.size-1]); stdout.Display(n);
stdout.Display(v[v.size-1]); stdout.Display(n);
for(i=2; i<v.size-1; i++){ stdout.Display(v[i]); stdout.Display(n); }

source

\$\endgroup\$
1
\$\begingroup\$

RProgN 2, 3 bytes


«Ø

Try it online!

This code does nothing with the first line, then, pushes the function «Ø. As « is unmatched, it falls through and executes the contents. Ø then pushes an empty string. The implicit printing behaviour first prints the empty string, then the function, giving our source code.

4 bytes

«•. 

(With a leading space)

Try it online!

This uses the fall through behavoir of the last quine, but ensures "quine" behavoir a different way. pushes a space, . concatenates it, which gives our code.

6 bytes

{`{.}{

Try it online!

This uses a different fallthrough behavoir. {`{.} pushes a funciton, then {, with an unmatched }, fails and moves the IP back to index 1, which skips the function definition, and runs its contents instead. (backtick){ pushes { as a string, then . appends it to the function, stringifying it. } then terminates the program, and the string is implicitely output.

\$\endgroup\$
1
\$\begingroup\$

OML, 20 bytes

"lK(34Tos)"lK(34Tos)

Try it online!

This was an interesting process. I initially started off with the classic data-decoder method of quining. That is, one devotes one section of the program to encoding the decoder, and another section to generate the data representation and decode the data. This came out to look like this (51 bytes):

'\'l'K'l'2'/'['('''''o'o')']'('o')\lKl2/[(''oo)](o)

Where the data section looks like:

'\'l'K'l'2'/'['('''''o'o')']'('o')

which pushes each character after a '. The decoder looks like this:

\lKl2/[(''oo)](o)
\                  reverse stack
 lK                duplicate stack
   l2/[            copy the duplication into a new stack
       (    )      while there are characters on this stack:
        ''o          output a single quote
           o         and the character
             ]     return to the original stack
              (o)  output all characters on this stack

This can be improved slightly by replacing (o) with ls (48 bytes):

'\'l'K'l'2'/'['('''''o'o')']'l's\lKl2/[(''oo)]ls

However, OML also has a length-encoded string construct. Let's say the string is "xyz". This is effectively 'x'y'z3, since there are three characters in the string. We can use s to print this string, but we still need to generate the quote characters. With all this in mind, I was able to devise the following approach (26 bytes):

"lK34Tos34Tos"lK34Tos34Tos

Simply put, this puts the "string" "lK34Tos34Tos" to the stack, then performs the following actions:

lK34Tos34Tos
lk            duplicate the stack (in this case, the string)
  34To        output a quotation mark "
      s       output the string
       34To   output another quotation mark "
           s  output the string again

We obtain our final version by noting that the structure 34Tos is repeated twice. We can use a while loop to produce the current answer.

\$\endgroup\$
1
\$\begingroup\$

Funky, 21 bytes

f=@write`f=[f]f()`f()

Try it online!

or, if Functions are allowed...

Funky, 9 bytes

f=@'f='+f

The second of these defines a function f which returns the string f=@'f='+f, the first however is a full program.

Try it online!

\$\endgroup\$
1
\$\begingroup\$

Aubergine, 21 bytes

-a1+a1=oA=Bi-BA:bB=ia   

This program ends with a trailing tab character.

\$\endgroup\$
3
  • \$\begingroup\$ Tab character?. \$\endgroup\$ Jan 26, 2017 at 21:47
  • 1
    \$\begingroup\$ I wrote this program in November 2015. I could have sworn I'd posted it here already. Anyway thanks for posting it and no thanks for not giving me credit. \$\endgroup\$
    – quintopia
    Dec 15, 2017 at 6:37
  • 1
    \$\begingroup\$ That doesn't make sense, you didn't post it on here, so how would I know you already wrote it lmao \$\endgroup\$
    – Oliver Ni
    Dec 16, 2017 at 7:02
1
\$\begingroup\$

Locksmith, 201 bytes

070405000400080701090704000102010702070000080006030109000107020001020106070707040507040001020107020700000800060301090001070200010201067450408719740121727008063190172012167774574012172700806319017201216

Try it online!

Formatted:

0704050004000807010907040001020107020700000800060301090001070200010
2010607070704050704000102010702070000080006030109000107020001020106
7450408719740121727008063190172012167774574012172700806319017201216

This consists of two parts: the data section and the decoder. The data section is simply each byte of the encoder prefixed with a 0 (which is the command to push that number). The decoder is:

74              // push stack length
5               // that many times:
   0408719      // output a 0
   74012172     // bring bottom of stack to the top
   700806319    // output this without popping
   0172         // swap top two (brings length to top)
   0121         // decrement
6               // close loop    

7774            // pop counter, push length again
5
   74012172     // bring bottom to top
   700806319    // output
   0172         // bring length to top
   0121         // decrement
6               // close loop
\$\endgroup\$
1
\$\begingroup\$

Swift 4, 120 bytes

import Foundation;let q="import Foundation;let q=%c%@%c;print(String(format:q,34,q,34))";print(String(format:q,34,q,34))

Try See it online!

Since this code imports Foundation, and the Swift corelibs can be a little quirky in non-macOS environments, you might not be able to run it (it doesn't work in TIO, or IBM's Swift Sandbox). If, however, you have a macOS environment, then you should be just fine.

\$\endgroup\$
1
\$\begingroup\$

Javascript REPL, 21 bytes

(_=$=>`(_=${_})()`)()
\$\endgroup\$
0
1
\$\begingroup\$

Foo, 136 111 96 bytes

I'm surprised to see that there's no Foo quine here yet!

>&41>&60>&99>&36>&40>&60>&41>&62>&105>&36>&34>&38>&62>&34>&40>&62>&41>&60>&40(<)>(">&"$i>)<($c<)

Try it online!

Explanation

This is pretty simple as far as quines go. There are two sections: the data and the decoder. The data is encoded on the array, and is decoded as such:

(<)>(">&"$i>)<($c<)

Which basically iterates once over the tape, outputting >& and the integer value of the cell, then iterating once again over the tape, outputting each character. The tape, then, is just the character codes of this decoder.

\$\endgroup\$
1
\$\begingroup\$

Yabasic, 103 bytes

An anonymous Yabasic quine

c$=Chr$(34):q$="c$=Chr$(34):q$=:?Left$(q$,15)+c$+q$+c$+Mid$(q$,16)":?Left$(q$,15)+c$+q$+c$+Mid$(q$,16)

Includes a trailing newline

Try it online!

\$\endgroup\$
1
\$\begingroup\$

Ahead, 8 bytes

"34 8ko@

Try it online!

\$\endgroup\$
1
\$\begingroup\$

!@#$%^&*()_+, 76 bytes

40Kjiiiiiiiiiiij,306j,6641,iK31,i,6j,,!!_+!^!&(@^!&)++!_+%(!_^^^^^^^^^^^_@%)

Try it online!

The code can be decomposed into two sections: the data and the decoder. The data is this:

40Kjiiiiiiiiiiij,306j,6641,iK31,i,6j,,

Each character pushes itself, and corresponds to a command (shifted up by 11).

The decoder is this:

!!_+!^!&(@^!&)++!_+%(!_^^^^^^^^^^^_@%)

This can also be divided into two parts, one which prints the data raw, and one which decodes the data. This part prints the initial data segment:

!!_+!^!&(@^!&)++!_+%
!!_+                     push 0 (duplicate twice then subtract)
                         this is our delineator
    !^                   push 1 (duplicate and increment)
                         this is our pointer
      !&                 push the entry at that index in the stack
        (    )           until the dilineator is found:
         @               output the stack entry
          ^              increment pointer
           !&            refresh entry at index
              ++!_+      pop top two (add twice, duplicate, subtract)
                   %     push 0 underneath stack

Then the decoder:

(!_^^^^^^^^^^^_@%)
(               %)    For each character:
 !_           _           subtract
   ^^^^^^^^^^^            11
               @          and output it
\$\endgroup\$
1
\$\begingroup\$

Muriel, 36 bytes

A:"\";.\"A:\\\"\"+|A+A";."A:\""+|A+A

Try it online!

Since Muriel isn't on TIO (yet!), I've included the interpreter in the link. Thanks Dennis!

Quines are the base component of any complex Muriel program, since they're a requirement for any sort of loop.

Explanation:

A:        Assign to A
  "       ...         "; An escaped version of ";."A:\""+|A+A
                        .          Print
                         "A:\""          A:"
                               +|A       Escaped version of A
                                  +A     Then A itself
\$\endgroup\$
1
\$\begingroup\$

Aubergine, 16 bytes

-a1+a1=oA:bA=iB

Try it online!

The program has a trailing null byte. Works similarly to my hello world.

\$\endgroup\$
1
\$\begingroup\$

Perl 6, 36

printf |(q<printf |(q<%s>xx 2)>xx 2)

Based on the Perl 5 quine.

\$\endgroup\$
0
1
\$\begingroup\$

C# (Visual C# Interactive Compiler), 57 bytes

var s="var s={0}{1}{0};Write(s,'{0}',s);";Write(s,'"',s);

Try it online!

There is another C# answer that uses a console application with a Main method. This approach seemed a little outdated given most current C# answers use the Visual C# Interactive Compiler. This compiler allows for a much shorter variation using the exact same technique.

\$\endgroup\$
1
\$\begingroup\$

C, 353 bytes

char q[]={125,59,109,97,105,110,40,41,123,112,114,105,110,116,102,40,34,99,104,97,114,32,113,91,93,61,123,34,41,59,99,104,97,114,42,112,61,113,59,119,104,105,108,101,40,42,112,41,112,114,105,110,116,102,40,34,37,100,44,34,44,42,112,43,43,41,59,112,117,116,115,40,113,41,59,125,};main(){printf("char q[]={");char*p=q;while(*p)printf("%d,",*p++);puts(q);}
\$\endgroup\$
18
  • 1
    \$\begingroup\$ With some golfing, including changing it from hexadecimal to decimal, this can be 354 bytes \$\endgroup\$
    – Jo King
    Aug 2, 2019 at 2:04
  • 1
    \$\begingroup\$ The link itself is a gcc compiler and it works fine. Are you sure they aren't just warnings? \$\endgroup\$
    – Jo King
    Aug 2, 2019 at 2:51
  • 1
    \$\begingroup\$ If only the output is erroring, then what is the difference between the two programs? What version of gcc are you using? \$\endgroup\$
    – Jo King
    Aug 2, 2019 at 3:15
  • 1
    \$\begingroup\$ ... What is the difference between the code of the two programs, not their behaviour. I already know that the second one fails. The version TIO uses is 8.3, and that works fine. \$\endgroup\$
    – Jo King
    Aug 2, 2019 at 3:32
  • 1
    \$\begingroup\$ I don't care about the output of the second generation quine. I would like to know the output of the first program, the one that didn't fail and produced something that did. I don't want to know about the errors that you have commented about several times already. I would like to know the difference between the program I have given you and its output. You can put the program in an online compiler like I have and link it in a comment below. \$\endgroup\$
    – Jo King
    Aug 2, 2019 at 3:49
1
\$\begingroup\$

Javascript (REPL), 23 22 21 bytes

someone else posted this first

(_=x=>`(_=${_})()`)()

paste into chrome console or equivalent to test

JavaScript (V8), 49 48 47 bytes

@NieDzejkob saved 1 byte on both versions

console.log((_=x=>`console.log((_=${_})())`)())

Try it online!

\$\endgroup\$
2
1
\$\begingroup\$

Keg, 8 6 4 bytes

`④`④

Try it online!

Answer History

8 bytes

`:.,`:.,

Try it online!

Why did it take me so long to figure out how to write a quine in Keg? I really should have picked up on this sooner.

Basically, it pushes the string :.,, duplicates it, prints the string repr'd and then prints it nicely.

\$\endgroup\$
1
\$\begingroup\$

W, 13 bytes

Print the data string & prepend quote.

p34CS+"p34CS+
\$\endgroup\$
1
\$\begingroup\$

tq, 8 bytes

New high-level language! (Technically inspired by Jo King's Symbolic Raku quine.)

etq'etq'

Explanation

   'etq' # Define the second item of the list
         # As a string
  q      # Surround the string with quotes
 t       # For the first item of the list,
         # Access the last (tail) item in the list,
e        # and un-quote the accessed value.

# The list becomes etq, 'etq' (comma is for readability)
# , which then becomes foreach-printed without any separator.
```
\$\endgroup\$
1
\$\begingroup\$

Common Lisp, 58 bytes

Lisp is perfect for quines because of using code as data, but terseness is not its strong suit.

(FORMAT T "(~{~S ~}~:*'~S)" '(FORMAT T "(~{~S ~}~:*'~S)"))

Excellent expert explanation.

(FORMAT T  -- print
"(      )" -- between parentheses
" ~{  }~ " -- looping over the list argument
" ~S_    " -- each item followed by a space
"   ~:*  " -- use the FORMAT sublanguage's *very* fancy
             -- "~*" directive (skip argument) with the ":"
             -- modifier to back up and reuse the argument
"    '~S " -- print the argument again with a quote before it
    '(FO.. -- the argument is the same thing but with a quote
             -- in front to show that it is data

Ideone it!

Alternative 9 bytes, that only works in the REPL

(prin1 -)

(use print for a trailing newline)

This prints the value of '-', which is the current expression being evaluated. You can try it here.

\$\endgroup\$
1
\$\begingroup\$

33, 24 bytes

"34cke12ketp"34cke12ketp

Try it online!

Explanation:

"34cke12ketp"               Push the string 34c0ke13ketp to the source string
             34c            Put 34 in the accumulator
                k           Push a " to the destination string
                 e          Append the source string to the destination string
                  12k       Push a " to the end of the destination string
                     e      Append the source string to the destination string
                      t     Swap the source and the destination string
                       p    And print the source string
\$\endgroup\$
1
\$\begingroup\$

4, 3101 bytes

3.611102101111601492000010000000160111200001000000016010020000100000001601002000010000000160139200001000000016019520000100000001601842000010000000160199200001000000016019920000100000001601092000010000000160190200001000000016010920000100000001601912000010000000160111200001000000016019920000100000001601992000010000000160121200001000000016011020000100000001601092000010000000160193200001000000016010020000100000001601892000010000000160101200001000000016011020000100000001601102000010000000160130200001000000016013020000100000001601002000010000000160100200001000000016019920000100000001601002000010000000160100200001000000016010920000100000001601202000010000000160100200001000000016010220000100000001601312000010000000160199200001000000016019920000100000001601282000010000000160199200001000000016019920000100000001601902000010000000160111200001000000016019920000100000001601992000010000000160127200001000000016019920000100000001601992000010000000160191200001000000016011120000100000001601892000010000000160179200001000000016012120000100000001601192000010000000160198200001000000016019320000100000001601992000010000000160110200001000000016019920000100000001601102000010000000160119200001000000016019920000100000001601922000010000000160101200001000000016011020000100000001601992000010000000160131200001000000016010820000100000001601042000010000000160100200001000000016011020000100000001601092000010000000160190200001000000016013020000100000001601302000010000000160160200001000000016019920000100000001601602000010000000160110200001000000016013020000100000001601302000010000000160151200001000000016010320000100000001601032000010000000160105200001000000016011020000100000001601302000010000000160130200001000000016010220000100000001601822000010000000160103200001000000016010120000100000001601182000010000000160129200001000000016012220000100000001601312000010000000160152200001000000016018220000100000001601252000010000000160110200001000000016012520000100000001601222000010000000160151200001000000016015120000100000001601022000010000000160120200001000000016011320000100000001601152000010000000160112200001000000016011120000100000001601012000010000000160131200001000000016012920000100000001601452000010000000160194200001000000016015920000100000001601452000010000000160194200001000000016015820000100000001601452000010000000160194200001000000016015020000100000001601552000010000000160184200001000000016015920000100000001601452000010000000160194200001000000016015920000100000001601452000010000000160145200001000000016015120000100000001601052000010000000160115200001000000016015420000100000001601542000010000000160156200001000000016011520000100000001601152000010000000160160200001000000016015020000100000001601562000010000000160194200001000000016019420000100000001601682000010000000160148200001000000016014620000100000001648486494965050651516545455150155454954954954855054954854954954954921310112151310220151522520152282513229281103028200303015030301503030106990603030990010040801399011029999101990199398991129798111999997299991109999982999913200002900000990000030301011098003990011299991119900990999948599300001194

Try it online!

Explanation

3.           Required boilerplate
6 11 10      Set cell 11 to 10
2 10 11 11   Set cell 10 to cell 11*cell 11 (10*10=100)

-- Data Section --
Every pair of digits in the program are represented by
6 01 49      Set cell 01 to the two digits joined together
2 00 00 10   Multiply cell 00 by 100
0 00 00 01   Add cell 01 to 00

This essentially makes cell 00 the rest of the program after the data section

6 48 48      Set each of the cells 48,49,50,51,54 to their respective values
6 49 49
6 50 50
6 51 51
6 54 54

551501554549549549548550549548549549549549  Print the initial section ('3.611102101111')

2 13 10 11   Initialise various powers of 10
2 15 13 10
2 20 15 15
2 25 20 15
2 28 25 13
2 29 28 11

0 30 28 20   Create the number '1000000010000200106', which is each data part backwards
0 30 30 15
0 30 30 15
0 30 30 10
6 99 06
0 30 30 99

0 01 00 40   Copy cell 00 to cell 01

8 01         Loop while cell 01 is not zero

  3 99 01 10    Integer divide cell 01 by 100 and store in cell 99
  2 99 99 10    Multiply cell 99 by 100
  1 99 01 99    Subtract cell 99 from cell 01 to get cell 01 modulo 100

  3 98 99 11
  2 97 98 11
  1 99 99 97
  2 99 99 11
  0 99 99 98    Swap the two digits of the modulo result
  2 99 99 13    Multiply it by 1000

  2 00 00 29    Multiply cell 00 by 10**19
  0 00 00 30    And append a copy of a data part
  0 00 00 99    And insert the modulo result in the correct place
  
  3 01 01 10    And divide cell 01 by 100
9            End loop

Now we print the number in cell 00 in reverse

8 00         Loop while cell 00 is non-zero
  3 99 00 11    Get the last digit of cell 00
  2 99 99 11
  1 99 00 99

  0 99 99 48    Add the digit to '0'
  5 99          And print

  3 00 00 11    Divide cell 00 by 10
9            End loop
\$\endgroup\$
3
  • \$\begingroup\$ I should write a SEDE query to see how many of the 362 quines you've written. \$\endgroup\$
    – Razetime
    Sep 19, 2020 at 17:00
  • \$\begingroup\$ @Razetime A search for inquestion:69 user:76162 currently puts it at 32 \$\endgroup\$
    – Jo King
    Sep 19, 2020 at 21:44
  • \$\begingroup\$ 8% of all the answers. I'm waiting for the day 50% comes. \$\endgroup\$
    – Razetime
    Sep 20, 2020 at 3:35
1
\$\begingroup\$

JavaScript (ES6), 11 bytes

a=_=>'a='+a

Try it online!

\$\endgroup\$
1
\$\begingroup\$

Groovy, 90 bytes

`s='s=\\\';s[0..1]+s[3]+s[0..1]+s[2]*6+s[3..-1]*2';s[0..1]+s[3]+s[0..1]+s[2]*6+s[3..-1]*`2

Edit

Works in GroovyConsole

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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