Golf you a quine for great good!

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;

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}
body='<h1>'+c.body.replace(OVERRIDE_REG,'')+'</h1>'});var match=body.match(SCORE_REG);if(match)
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)

• Do you not mean, "Golf you a quine for greater good!"? – Mateen Ulhaq May 3 '11 at 2:49
• @muntoo it's a play on "Learn you a Haskell for Great Good". – Rafe Kettler May 3 '11 at 2:52

Cheddar, 56 bytes

Try this one online!

let q='let q=%s%s%s;print IO.sprintf(q,@"39,q,@"39)';print IO.sprintf(q,@"39,q,@"39)

See the explanation below, except mentally replace % with IO.sprintf.

Well darn. @ETHProductions came up with this solution before me..

This is the shortest I could come up with... Maybe some abuse of functional operators could help me.

let q='let q=%s;print q%@"39+q+@"39';print q%@"39+q+@"39

Try it online! You can guess what the output is.

This code can be divided into two parts: the string and the output. The string part:

let q='let q=%s;print q%@"39+q+@"39';

is simply a formatting template.

The output part:

;print q%@"39+q+@"39

formats the string. @"39 is char 39, or '.

Pushy, 9 bytes

95 34
_"

(non-competing as the language postdates the challenge)

Although writing functional programs in Pushy is sometimes difficult, the quine is relatively simple:

95   % Push 95 to the stack (ASCII code for _ )
34   % Push 34 to the stack (ASCII code for " )
_    % Print representation of the stack: 95 34
"    % Print stack converted to string: _"

Notice that, although Pushy ignores newlines, it is needed here because the default separator for printing is \n - and there needs to be a trailing newline, hence making it 9 bytes

Alternatively, an 11-byte solution that does not require a newline:

78 95 34N_"

Works similarly to the one above, but N sets the separator an empty string.

Java 8, 94 bytes

()->{String s="()->{String s=%c%s%1$c;System.out.printf(s,34,s);}";System.out.printf(s,34,s);} This is a lambda expression which prints its own source code to STDOUT. It uses a similar tactic to other Java quines here, but the lambda really helps cut down bytes. If we wanted to be really cheeky and cut down two bytes, we could declare the lambda as x->, where x is an empty string, as according to meta, "taking no input" means you can assume empty input, and in function submissions input is given as a parameter. Python 3, 38 bytes There are already a lot of Python quines, but as far as I can see this one hasn't been posted yet. Technically it is a statement that evaluates to a string representation of itself, but other submissions do similar things. '.__repr__()[:-1]*2'.__repr__()[:-1]*2 This works in a similar way to many quines in 2D langauges with "edge-wrap", where "string mode" is entered, the whole program is pushed to the stack, then string mode is executed and the program runs, printing the string mode character (usually ") followed by the contents of the stack (i.e. the program's source) then exiting. A breakdown of the statement is as follows: '.__repr__()[:-1]*2' # A string containing the body of the program. # .__repr__()[:-1]*2 .__repr__() # The same string, but enclosed in single quote marks. # '.__repr__()[:-1]*2' [:-1] # A splice that crops off the last character. # '.__repr__()[:-1]*2 *2 # Repeat the string. # '.__repr__()[:-1]*2'.__repr__()[:-1]*2 The reason I have used .__repr__() instead of repr(string) is because the quine relies on code following and not preceding the string. This is also why this is a statement and not a program; the print() function requires code before the string, which is not possible with this quine layout. As you may have noticed, there's a much golfier statement that evaluates to this statement: "'.__repr__()[:-1]*2"*2 But this isn't a quine, because it doesn't evaluate to itself. • Unfortunately, I don't think this is valid, since it's an expression (and therefore a snippet) rather than a full program. – Esolanging Fruit Jul 30 '17 at 2:33 Threead, 101 bytes >91>60>93>62>91>105>54>50>99>111>100>111>62>93>60>91>60>93>62>91>99>111>62>93[<]>[i62codo>]<[<]>[co>] Try it online! My first thought for writing a Threead quine was to store the entire data section as one large number, in order to get a good compression ratio. This doesn't work because a) % appears to be broken, and b) Threead doesn't support bignum arithmetic. Instead, I wrote this solution, which works along the same lines as a brainfuck quine, storing the characters of the code section of the program as individual tape elements. Then we just have to scan the list once in order to print it as data, and again to print it as code. Although Threead allows for three threads, and requires their use when performing binary operations, this style of quine uses only unary operations and thus there was no point in using more than one thread, so I just did everything inside the first. Explanation >91>60>…>62>93 ASCII character codes of the rest of the program [<]> Return the pointer to the start of the data [ While the current data cell is nonzero: i62 Place 62 (ASCII code of >) on a temporary tape cell co Output it as a character (i.e. >) d Delete the temporary tape cell o Output the current data element as an integer >] then continue the loop with the next data cell <[<]> Return the pointer to the start of the data [ While the current data cell is nonzero: co Output it as a character >] then continue the loop with the next data cell • Nice. Basically the same as mine but with > at the beginning. I like it – Riley Jan 16 '17 at 23:01 • I hope you don't mind that I used that trick in my new version :) – Riley Jan 16 '17 at 23:23 • @Riley: That's OK, we're pretty much all cooperating to improve the quine at this point. – user62131 Jan 16 '17 at 23:25 Alice, 9 bytes Credits to Sp3000 for the idea of including the !. "!<@o&9h. Try it online! Explanation This works much like quines in other Fungeoids with an unmatched " that wraps the entire code (except itself) in a string because the instruction pointer move cyclically through the code. "!<@o&9h." Push code points of the entire program except the " to the stack (irrelevant). ! Store 46 (the code point of '.') on the tape (irrelevant). < Send IP back west. ! Store 104 (the code point of 'h') on the tape (irrelevant). ".h9&o@<!" Push code points of the entire program except the " to the stack in reverse. . Duplicate the 33 (the code point of '!'). h Increment to 34 (the code point of '"'). Now the top nine values on the stack correspond to the entire code in reverse order. 9& Repeat the next command 9 times. o Print 9 characters from the top of the stack. @ Terminate the program. Ohm, 22 20 bytes -2 bytes thanks to Business Cat "D34'DLaJL"D34'DLaJL Try it online! "D34'DLaJL" # Push this string (everything after this) D # Duplicate 34' # Push the character " D # Duplicate L # Print " a # Swap the top 2 elements JL # Print the string, ", then the string again. • You can save 2 bytes by replacing LLL with JL (in both occurrences). – Business Cat May 18 '17 at 17:56 x86/DOS assembly, 4619 bytes bits 16 org 256 mov ah,64 mov bx,1 mov cx,720 mov dx,b+16 int 33 mov cx,90 mov si,b+16 c:push cx mov ah,64 mov bx,1 mov cx,6 mov dx,b int 33 mov cx,7 a:push cx mov al,[si] shr al,4 add al,48 cmp al,58 jb g add al,39 g:mov [b+8],al lodsb and al,15 add al,48 cmp al,58 jb e add al,39 e:mov [b+9],al mov ah,64 mov bx,1 mov cx,5 mov dx,b+6 int 33 pop cx loop a mov al,[si] shr al,4 add al,48 cmp al,58 jb h add al,39 h:mov [b+8],al lodsb and al,15 add al,48 cmp al,58 jb n add al,39 n:mov [b+9],al mov ah,64 mov bx,1 mov cx,4 mov dx,b+6 int 33 pop cx loop c mov ah,64 mov bx,1 mov cx,5 mov dx,b+11 int 33 mov ah,76 int 33 b db 13,10,' db 0x ,',13,10,'end' db 0x62,0x69,0x74,0x73,0x20,0x31,0x36,0x0d db 0x0a,0x6f,0x72,0x67,0x20,0x32,0x35,0x36 db 0x0d,0x0a,0x6d,0x6f,0x76,0x20,0x61,0x68 db 0x2c,0x36,0x34,0x0d,0x0a,0x6d,0x6f,0x76 db 0x20,0x62,0x78,0x2c,0x31,0x0d,0x0a,0x6d db 0x6f,0x76,0x20,0x63,0x78,0x2c,0x37,0x32 db 0x30,0x0d,0x0a,0x6d,0x6f,0x76,0x20,0x64 db 0x78,0x2c,0x62,0x2b,0x31,0x36,0x0d,0x0a db 0x69,0x6e,0x74,0x20,0x33,0x33,0x0d,0x0a db 0x6d,0x6f,0x76,0x20,0x63,0x78,0x2c,0x39 db 0x30,0x0d,0x0a,0x6d,0x6f,0x76,0x20,0x73 db 0x69,0x2c,0x62,0x2b,0x31,0x36,0x0d,0x0a db 0x63,0x3a,0x70,0x75,0x73,0x68,0x20,0x63 db 0x78,0x0d,0x0a,0x6d,0x6f,0x76,0x20,0x61 db 0x68,0x2c,0x36,0x34,0x0d,0x0a,0x6d,0x6f db 0x76,0x20,0x62,0x78,0x2c,0x31,0x0d,0x0a db 0x6d,0x6f,0x76,0x20,0x63,0x78,0x2c,0x36 db 0x0d,0x0a,0x6d,0x6f,0x76,0x20,0x64,0x78 db 0x2c,0x62,0x0d,0x0a,0x69,0x6e,0x74,0x20 db 0x33,0x33,0x0d,0x0a,0x6d,0x6f,0x76,0x20 db 0x63,0x78,0x2c,0x37,0x0d,0x0a,0x61,0x3a db 0x70,0x75,0x73,0x68,0x20,0x63,0x78,0x0d db 0x0a,0x6d,0x6f,0x76,0x20,0x61,0x6c,0x2c db 0x5b,0x73,0x69,0x5d,0x0d,0x0a,0x73,0x68 db 0x72,0x20,0x61,0x6c,0x2c,0x34,0x0d,0x0a db 0x61,0x64,0x64,0x20,0x61,0x6c,0x2c,0x34 db 0x38,0x0d,0x0a,0x63,0x6d,0x70,0x20,0x61 db 0x6c,0x2c,0x35,0x38,0x0d,0x0a,0x6a,0x62 db 0x20,0x67,0x0d,0x0a,0x61,0x64,0x64,0x20 db 0x61,0x6c,0x2c,0x33,0x39,0x0d,0x0a,0x67 db 0x3a,0x6d,0x6f,0x76,0x20,0x5b,0x62,0x2b db 0x38,0x5d,0x2c,0x61,0x6c,0x0d,0x0a,0x6c db 0x6f,0x64,0x73,0x62,0x0d,0x0a,0x61,0x6e db 0x64,0x20,0x61,0x6c,0x2c,0x31,0x35,0x0d db 0x0a,0x61,0x64,0x64,0x20,0x61,0x6c,0x2c db 0x34,0x38,0x0d,0x0a,0x63,0x6d,0x70,0x20 db 0x61,0x6c,0x2c,0x35,0x38,0x0d,0x0a,0x6a db 0x62,0x20,0x65,0x0d,0x0a,0x61,0x64,0x64 db 0x20,0x61,0x6c,0x2c,0x33,0x39,0x0d,0x0a db 0x65,0x3a,0x6d,0x6f,0x76,0x20,0x5b,0x62 db 0x2b,0x39,0x5d,0x2c,0x61,0x6c,0x0d,0x0a db 0x6d,0x6f,0x76,0x20,0x61,0x68,0x2c,0x36 db 0x34,0x0d,0x0a,0x6d,0x6f,0x76,0x20,0x62 db 0x78,0x2c,0x31,0x0d,0x0a,0x6d,0x6f,0x76 db 0x20,0x63,0x78,0x2c,0x35,0x0d,0x0a,0x6d db 0x6f,0x76,0x20,0x64,0x78,0x2c,0x62,0x2b db 0x36,0x0d,0x0a,0x69,0x6e,0x74,0x20,0x33 db 0x33,0x0d,0x0a,0x70,0x6f,0x70,0x20,0x63 db 0x78,0x0d,0x0a,0x6c,0x6f,0x6f,0x70,0x20 db 0x61,0x0d,0x0a,0x6d,0x6f,0x76,0x20,0x61 db 0x6c,0x2c,0x5b,0x73,0x69,0x5d,0x0d,0x0a db 0x73,0x68,0x72,0x20,0x61,0x6c,0x2c,0x34 db 0x0d,0x0a,0x61,0x64,0x64,0x20,0x61,0x6c db 0x2c,0x34,0x38,0x0d,0x0a,0x63,0x6d,0x70 db 0x20,0x61,0x6c,0x2c,0x35,0x38,0x0d,0x0a db 0x6a,0x62,0x20,0x68,0x0d,0x0a,0x61,0x64 db 0x64,0x20,0x61,0x6c,0x2c,0x33,0x39,0x0d db 0x0a,0x68,0x3a,0x6d,0x6f,0x76,0x20,0x5b db 0x62,0x2b,0x38,0x5d,0x2c,0x61,0x6c,0x0d db 0x0a,0x6c,0x6f,0x64,0x73,0x62,0x0d,0x0a db 0x61,0x6e,0x64,0x20,0x61,0x6c,0x2c,0x31 db 0x35,0x0d,0x0a,0x61,0x64,0x64,0x20,0x61 db 0x6c,0x2c,0x34,0x38,0x0d,0x0a,0x63,0x6d db 0x70,0x20,0x61,0x6c,0x2c,0x35,0x38,0x0d db 0x0a,0x6a,0x62,0x20,0x6e,0x0d,0x0a,0x61 db 0x64,0x64,0x20,0x61,0x6c,0x2c,0x33,0x39 db 0x0d,0x0a,0x6e,0x3a,0x6d,0x6f,0x76,0x20 db 0x5b,0x62,0x2b,0x39,0x5d,0x2c,0x61,0x6c db 0x0d,0x0a,0x6d,0x6f,0x76,0x20,0x61,0x68 db 0x2c,0x36,0x34,0x0d,0x0a,0x6d,0x6f,0x76 db 0x20,0x62,0x78,0x2c,0x31,0x0d,0x0a,0x6d db 0x6f,0x76,0x20,0x63,0x78,0x2c,0x34,0x0d db 0x0a,0x6d,0x6f,0x76,0x20,0x64,0x78,0x2c db 0x62,0x2b,0x36,0x0d,0x0a,0x69,0x6e,0x74 db 0x20,0x33,0x33,0x0d,0x0a,0x70,0x6f,0x70 db 0x20,0x63,0x78,0x0d,0x0a,0x6c,0x6f,0x6f db 0x70,0x20,0x63,0x0d,0x0a,0x6d,0x6f,0x76 db 0x20,0x61,0x68,0x2c,0x36,0x34,0x0d,0x0a db 0x6d,0x6f,0x76,0x20,0x62,0x78,0x2c,0x31 db 0x0d,0x0a,0x6d,0x6f,0x76,0x20,0x63,0x78 db 0x2c,0x35,0x0d,0x0a,0x6d,0x6f,0x76,0x20 db 0x64,0x78,0x2c,0x62,0x2b,0x31,0x31,0x0d db 0x0a,0x69,0x6e,0x74,0x20,0x33,0x33,0x0d db 0x0a,0x6d,0x6f,0x76,0x20,0x61,0x68,0x2c db 0x37,0x36,0x0d,0x0a,0x69,0x6e,0x74,0x20 db 0x33,0x33,0x0d,0x0a,0x62,0x20,0x20,0x20 db 0x64,0x62,0x20,0x31,0x33,0x2c,0x31,0x30 db 0x2c,0x27,0x20,0x64,0x62,0x20,0x30,0x78 db 0x20,0x20,0x2c,0x27,0x2c,0x31,0x33,0x2c db 0x31,0x30,0x2c,0x27,0x65,0x6e,0x64,0x27 end 80x86 TASM, 561 bytes MODEL TINY .CODE .STARTUP DB 177 DB 076 DB 186 DB 044 DB 001 DB 172 DB 180 DB 036 DB 179 DB 004 DB 191 DB 080 DB 001 DB 079 DB 136 DB 037 DB 212 DB 010 DB 004 DB 048 DB 134 DB 196 DB 075 DB 117 DB 244 DB 180 DB 009 DB 205 DB 033 DB 178 DB 071 DB 226 DB 228 DB 178 DB 038 DB 205 DB 033 DB 195 DB 013 DB 010 DB 069 DB 078 DB 068 DB 036 DB 077 DB 079 DB 068 DB 069 DB 076 DB 032 DB 084 DB 073 DB 078 DB 089 DB 013 DB 010 DB 046 DB 067 DB 079 DB 068 DB 069 DB 013 DB 010 DB 046 DB 083 DB 084 DB 065 DB 082 DB 084 DB 085 DB 080 DB 013 DB 010 DB 068 DB 066 DB 032 END • @Downvoter I can kind of understand the downvotes on all the quines I posted from RosettaCode, but this one, really? – MD XF May 25 '17 at 17:23 ACL2, 41 bytes (let((q"(let((q~x0))(cw q q))"))(cw q q)) Excel, 131 bytes =SUBSTITUTE("=SUBSTITUTE(@,CHAR(64),CHAR(34)&@&CHAR(34))",CHAR(64),CHAR(34)&"=SUBSTITUTE(@,CHAR(64),CHAR(34)&@&CHAR(34))"&CHAR(34)) Adapted from a program by Dave Burt. Go, 112 bytes As far as I can tell, there's no Go answer here. Here's mine and I think this is the shortest possible. package main;import.fmt;func main(){s:="package main;import.fmt;func main(){s:=%q;Printf(s,s)}";Printf(s,s)} Try it online! QBIC, 8 bytes ?A+@?A+@ I was trying to do this, but I accidentally golfed an actual quine. Whadda you know? Explanation ? Print A A$
+         concatenated with
@       a string literal containing
?A+@   "?A+@"

When A$is used the first time, it might not seem to have a value yet, but it already contains the string literal ?A+@ because the QBIC interpreter first scans the code, sees the @, looks up what the first available string variable is (it's A$, because it hasn't been used by other QBIC language features yet), and it then extracts the definition A$= "?A+@" to the top of the file, and inserts A$ at the place where it found the literal.

Micro, 5 bytes

{_BS}

Explination:

{_BS}

{      start a code block (this block will be run due to implicit evaluation)
_     push the item most recently popped. this pushes the code block which was popped due to implicit evaluation
BS}  convert the code block to a string, and end the block. Micro's implicit evaluation is weird, because the evaluated variable may generate new items on the stack, in which case the program's execution will continue as if it hadn't ended. this second implicit evaluation displays the string which is left on the stack: "{_BS}", and ends execution.

f:(c{"f:(c{"")]concat(substr(c,0,6),c,substr(c,6,41))")]concat(substr(c,0,6),c,substr(c,6,41))

Watch out for quotation marks autocompletion in the editor!

This should create a parameterless function f which returns its own code.

This quine makes use of (another) weird feature of Mathcad: you can put as much quotation marks inside a string as you like. No idea how they handle it...

JScript, 175 bytes

WScript.Echo((k="WScript.Echo((k=\"%Z\").replace(/%[Z]/,k.replace(/[\"\\\\]/g,function(e){return\"\\\\\"+e})))").replace(/%[Z]/,k.replace(/["\\]/g,function(e){return"\\"+e})))

JScript is Microsoft's implementation of the JavaScript language. On a microsoft console, you can invoke the program as <name>.js, and this will output to a popup. To output to the console, one must use:

cscript //E:JScript //nologo <name>.js

and add a trailing CRLF to the source code.

Foam, 15 bytes

[. <' |: ~|]: ~

This prints itself with a trailing newline. Without a trailing newline:

[. .' |: ~|]: ~

Gaia, 10 bytes

“:ṙpp”:ṙpp

Try it online!

Explanation

“:ṙpp”      Push this string.
:     Copy it.
ṙ    Get the string representation of it.
p   Print the string representation.
p  Print the string.

PHP, 50 chars

<?printf($s='<?printf($s=%c%s%1$c,39,$s);',39,$s); I realized I could save four chars by enabling short tags (<?=sprintf becomes <?printf) I saved four more bytes by reusing one of the values in my printf. Proton, 32 30 bytes -2 bytes thanks to ppperry. s='s=%rprint(s%%s)'print(s%s) Try it online! I swear, if I get a bounty for this... • Hey, I promised a bounty, so if nobody beats it, good for you I guess :P – HyperNeutrino Aug 17 '17 at 19:39 • You can save two bytes by deleting the semicolons – pppery Aug 18 '17 at 22:18 C (tcc), 64 bytes main(t){printf(t,34,t="main(t){printf(t,34,t=%c%s%c,34);}",34);} Try it online! could be one problem if compiler not use the stack based way of push arguments. result of the print (tcc, gcc all in TIO today at last ok (not ok in clang)): main(t){printf(t,34,t="main(t){printf(t,34,t=%c%s%c,34);}",34);} • Related – No one Dec 23 '17 at 19:09 V, 4 bytes 2i2i Try it online! Marked as non-competing because this language postdates the challenge by several years. Explanation: 2 " Two times: i " Insert the following: 2i " The string '2i' This is pretty straightforward. In fact, this almost works in regular vim. There is just one minor thing in the way: The string '2i' isn't inserted twice until you hit <esc>. In V, this is solved by implicitly ending every program with an <esc> (Really, that's an oversimplification, but it's close enough to the truth). Old versions of V always added a newline to the output, which is why I didn't post this earlier. However, in commit b6c238d, this was fixed. This answer works just because of luck. The approach doesn't extend well to general purpose quines/quine-variations. The shortest quine I'm aware of that can be trivially modified is ñéÑ~"qpÿ Try it online! Explanation: ñ " Start recording into register 'q' éÑ " Insert 'Ñ' (uppercase so that the recording doesn't stop here) ~ " Toggle the case the character under the cursor (the 'Ñ') "qp " Paste the contents of register 'q' ÿ " Stop recording and play it all back The reason the ÿ is needed, is because it is implicitly added to the end of macros, a feature that is unfortunate for quines, but very convenient for golf. The nice thing about this quine is that we can do almost anything inside of the recording and it is still valid since it will be pasted later anyway. MaybeLater, 74 bytes x="write(('x='+chr(34))+x+(chr(34))+x)"write(('x='+chr(34))+x+(chr(34))+x) Try it online! 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 • is this an error quine? – Destructible Lemon May 24 '17 at 23:53 • @DestructibleLemon No, why do you ask? – MD XF May 25 '17 at 0:46 • Anyone care to explain the serial downvoting? – MD XF May 25 '17 at 17:20 Java 8 - 392 bytes interface Q{static void main(String[]a){p("interface Q{static void main(String[]a){p(");q(");}static void p(String s){System.out.print(s+(char)34+s+(char)34+')'+';'+'q'+'('+(char)34);}static void q(String s){System.out.print(s+(char)34+s);}}");}static void p(String s){System.out.print(s+(char)34+s+(char)34+')'+';'+'q'+'('+(char)34);}static void q(String s){System.out.print(s+(char)34+s);}} The main trick with this was using 34 cast to a character for the quotes that bound the string literals in order to not run into issues. • Welcome to PPCG! – Steadybox Jan 9 '18 at 15:53 Wumpus, 9 bytes "#34#9&o@ Try it online! Explanation This is a fairly standard Fungeoid quine. However, as opposed to most other Fungeoids, Wumpus's grid doesn't wrap around, so the IP actually bounces back and forth through the code: "#34#9&o@o&9#32#" This pushes the individual code points of this string to the stack. #34 Push 34. #9 Push 9. &o Print 9 characters from the top of the stack. @ Terminate the program. There are several other ways to do this in 9 bytes, e.g. this one which generates the " from the # instead: "#9[(~&o@ I haven't yet found a way to get it down to 8 bytes though (it might be possible: if there's a way to generate the 34 in three bytes that doesn't end in a digit, we could get rid of the # in front of the 9). Rust, 108 characters macro_rules!f(()=>("macro_rules!f(()=>({:?}));fn main(){{print!(f!(),f!())}}"));fn main(){print!(f!(),f!())} This is a suboptimal solution, but it's so close to the current shortest solution that I wanted to post it anyway as it uses a completely different strategy. I think it can be optimized by using macro keyword instead of verbose macro_rules! when it becomes stable (which would reduce this to 96 characters). Pari/GP, 29 bytes (f=()->print1("(f="f")()"))() Try it online! Swift 4, 63 bytes let s=[";print(\"let s=\\(s)\"+s[0])"];print("let s=\(s)"+s[0]) Try it online! SmileBASIC, 66 54 bytes ?MID$(("+CHR$(34))*3,19,54)?MID$(("+CHR\$(34))*3,19,54)

This will work in most BASIC dialects.