245
\$\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
10 11
12
13 14
16
2
\$\begingroup\$

Integral, 18 12 Bytes

⌡^♦►◙►⌡^♦►◙►

Try it not on TIO!

\$\endgroup\$
2
  • \$\begingroup\$ Can you update this? A resolution is in the issues on the GitHub. \$\endgroup\$
    – nph
    Aug 5, 2020 at 15:56
  • 1
    \$\begingroup\$ ⌡^♦►◙►⌡^♦►◙► (12 bytes). Same length as your previous 12-byter, but with the "bug" fixed. \$\endgroup\$
    – user96495
    Aug 7, 2020 at 0:34
2
\$\begingroup\$

(()), 3560 bytes

Let
(
=()
Let
)
=(())
Let


=(()())
Let
L
=((()))
Let
e
=(()(()))
Let
t
=((())())
Let
=
=(((())))
(((()(()))(()))(()()()(())(())(())()()(())()()(())(())(())()()()(())(())()(())(())()()(())()(())(())()(())()()(())()(())(())()()()()(())(())(())(())()(())()()(())(())()()(())()(())(())()()()(())(())(())()()(())()()(())(())(())()()()(())(())()(())(())()()(())()(())(())()()(())(())()()(())()(())(())()()()()(())(())(())(())()(())()(())()()(())(())()()(())(())()()(())()(())(())()()()(())(())(())()()(())()()(())(())(())()()()(())(())()(())(())()()(())()(())(())()()(())()(())(())()()(())()(())(())()()()()(())(())(())(())()(())()(())()()(())(())()(())()()(())(())()()(())(())()()(())()(())(())()()()(())(())(())()()(())()()(())(())(())()()()(())(())()(())(())()()(())()(())(())()()()(())(())(())()()(())()(())(())()()()()(())(())(())(())()(())()(())()(())()()(())(())()()(())(())()()(())(())()()(())()(())(())()()()(())(())(())()()(())()()(())(())(())()()()(())(())()(())(())()()(())()(())(())()()(())()()(())(())(())()()(())()(())(())()()()()(())(())(())(())()(())()(())()()(())(())()(())()(())()()(())(())()()(())(())()()(())(())()()(())()(())(())()()()(())(())(())()()(())()()(())(())(())()()()(())(())()(())(())()()(())()(())(())()()()(())(())()(())(())()()(())()(())(())()()()()(())(())(())(())()(())()(())()(())()()(())(())()()(())(())()(())()()(())(())()()(())(())()()(())()(())(())()()()(())(())(())()()(())()()(())(())(())()()()(())(())()(())(())()()(())()(())(())()()()()(())(())(())(())()()(())()(())(())()()()()(())(())(())(())()(())()(())()(())()(())()()(())(())()()(())(())()()(())(())()()(())(())()()(())()(())(())()(())()(())()(())()(())()()(())(())()(())()(())()()(())(())()()(())(())()()(())(())()(())()(())()()(())(())()()(())(())()()(())(())()(())()()()(())(())(())()()(())()()(())(())(())()()(())(())()()()(())(())(())()()(())(())()()(())(())()(())()(())()(())()(())()(())()(())()()(())(())()()(())(())()()(())(())()(())()(())()(())()()(())(())()()(())(())()()(())(())()()(())(())()(())()()(())(())()()(())(())()()(())(())()(())()(())()(())()(())()(())()()(())(())()()(())(())()()(())(())()(())()()(())(())()()(())(())()(())()(())()()(())(())()(())()(())()()(())(())()()(())(())()(())()(())()(())()()(())(())()()(())(())()()(())(())()()(())(())()()(())(())()(())()(())()(())()(())()(())()()(())(())()()(())(())()()(())(())()(())()(())()()(())(())()()(())(())()()(())(())()(())()(())()()(())(())()(())()()(())(())()(())()(())()()(())(())()()(())(())()(())()(())()()(())(())()()(())(())()(())()(())()(())()()(())(())()()(())(())()()(())(())()()(())(())()()(())(())()(())()(())()()(())()()(())(())(())()()(())(())(())(())))(((((()))((())))()))((((()))())(()(())((()))))((((()))(()))(()()(())(())((()))))((((()))(()(()))((())())(()())()(()())(((())))()(())(()())((()))(()(()))((())())(()())(())(()())(((())))()()(())(())(()())((()))(()(()))((())())(()())(()())(()())(((())))()()(())()(())(())(()())((()))(()(()))((())())(()())((()))(()())(((())))()()()(())(())(())(()())((()))(()(()))((())())(()())(()(()))(()())(((())))()()(())()()(())(())(())(()())((()))(()(()))((())())(()())((())())(()())(((())))()()()(())(())()(())(())(()())((()))(()(()))((())())(()())(((())))(()())(((())))()()()()(())(())(())(())(()())()()()()(())()()(())(())(())()()(())(())(())()((()))(()(()))(())((()))(())(())()()()()()()(())(())(())()()()(())(())(())(())()(())(())(())()()()()()(())(())(())()(())(())()()(())()()(())(())()()()(())(())(())(())(())()()()()()(())(())(())()()(())(())(())()()(())()(())()()(())(())()()(())(())()()()(())(())(())(())(())()()(()(()))(())))

Try it online!

This probably isn't the optimal strategy (since it was the first one I thought of), but I've golfed this down enough that I feel confident posting it. I wrote a helper program to generate this program

(()) is a string re-writing scheme designed to only use parentheses. The top lines of Let x = (()) are to assign characters to the sets of parentheses so that input and output can make sense, but otherwise the entire program is that 3400 byte string at the bottom. Essentially it boils down to a series of string rewrite rules:

"e)" -> "large data string"
"LL" -| ""         (terminate on this substitution)
"L(" -> "()L"
"L)" -> "(())L"
"" -> "Initialisation (((()(()))(()))(Le)L))(((((()))((())))()))((((()))())(()(())((()))))((((()))(()))(()()(())(())((()))))((e)"

First we start with the input, which is empty. Only the last rule matches the empty string, so we replace the current string with the result from that:

Initialisation (((()(()))(()))(Le)L))(((((()))((())))()))((((()))())(()(())((()))))((((()))(()))(()()(())(())((()))))((e)

The first rule to match this string is the e) rule (which is constructed to avoid matching anything in the initialisation section). This matches twice, and we substitute the first and then the second, since none of the other rules before it apply:

Initialisation (((()(()))(()))(L large data string L))(((((()))((())))()))((((()))())(()(())((()))))((((()))(()))(()()(())(())((()))))(( large data string

The large data string is the parentheses representation of the original empty string substitution, which means that this is almost the final product, except that the first copy of data string needs to itself be translated to the parentheses version. We use the L( and L) rules to turn each character into it representation. Once we run out of those, the output looks like:

Initialisation (((()(()))(()))(large data string representation LL))(((((()))((())))()))((((()))())(()(())((()))))((((()))(()))(()()(())(())((()))))(( large data string

So we finally execute the LL rule, replacing LL with nothing and terminating the program.

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

*><>, 14 bytes

"#ooooooo;!-1:

Try it online!

*><> doesn't offer much more than its parent language ><> apart from file input and some new movement commands, neither of which are useful here. In fact, this is longer than the ><> quine, since *><> outputs the error to STDOUT, meaning we can't exit with an error.

Explanation:

"                   Wrapping string, pushing the code to the stack
 #                  Mirror, reverse directions
"                   Pushing the code to the stack in reverse
           -1:      Duplicate the top of the stack (#) and subtract one to get "
         ;!         Skip over the terminate
  ooooooo           Print seven characters
 #                  Mirror
  ooooooo           Print the other seven characters
         ;          And terminate
\$\endgroup\$
2
\$\begingroup\$

,,,, 15 bytes

"'%r:%%1⊢":%1⊢

Try it online!

Commata is a very underdeveloped golfing language. This makes use of the string formatting command to format the data with double quotes.

Explanation

"'%r:%%1⊢"       Push '%r:%%1⊢ to the stack
          :      Duplicate the string
           %     Format one string with the other
 '%r             Python's string repr with double quotes
            1⊢   And drop the leading '
\$\endgroup\$
2
\$\begingroup\$

ABC, 89 bytes

PUT {"0INa"; "1WRITE 'PUT',a"; "2FORbINa:WRITEb@2/"} INa
WRITE 'PUT',a
FORbINa:WRITEb@2/

Try it online!

This is one of those weird old languages, this one being "originally intended as a good replacement for BASIC". It has a few strange quirks, such as lists are iterated in sorted order, and you can only print newlines using a WRITE. At least the object to string conversion works well, and tokens can be placed right next to each other.

Explanation

PUT {"0INa"; 
     "1WRITE 'PUT',a"; 
     "2FORbINa:WRITEb@2/"}
INa                            Set a to the list of strings
WRITE 'PUT',a                  Print "PUT" and the list
FORbINa:                       Iterate over each string in the list
        WRITE                  Print
             b@2               The string excluding the first character
                /              And a newline

I don't think this ir quite optimal, but I think it's pretty close. You can't have a two line quine, since both lines would have to encode themselves, and I can't think of a way to do a one line quine.

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

Adapt, 19 bytes

`@96cs+.+`@96cs+.+

Try it online!

Explanation

`@96cs+.+`               Push string "@96cs+.+"
          @96            Push 96
             c           Convert it to the character "`"
              s+         Swap the two and concatenate "`@96cs+.+"
                .+       Duplicate and concatenate "`@96cs+.+`@96cs+.+"
                         Implicitly output
\$\endgroup\$
1
  • 1
    \$\begingroup\$ Bloody hell, I had no idea Adapt was actually usable, that's super cool! \$\endgroup\$ Sep 21, 2020 at 11:01
2
\$\begingroup\$

Add++ -i, 14 bytes

L,"L,%rd%%"d%

Try it online!

Takes advantage of Python string formatting with the % command. Uses the -i flag to run the function without having to call it.

\$\endgroup\$
0
2
\$\begingroup\$

Labyrinth, 52 bytes

411096280599923751453245172184368156!
_
2/:@
" .
71_

Try it online!

Just beats out the previous Labyrinth quine by one byte, through using the modulo behaviour of ., and an unorthodox divisor.

Explanation:

This uses a similar setup to the other answer, but where that used a divmod of 98, this divides by 172 and modulos by 256. This first saves on the decoder section because the . instruction already moduloes by 256 before printing. But this alone isn't enough, so I started looking for a smaller divisor.

This is possible by brute-forcing the required number through rearranging the source code until it works, and only when the encoded string is really small (in this case 16 bytes). I wrote a Raku script to help brute force these variations of the code, with minor tweaks needed for different layouts.

The code itself is a simple loop

.....!  Push number and print it
.....   Then reverse direction, pushing the number in reverse

_       Enter the loop by
2/`     Integer dividing the initial number by 2
` `
```

``:     Duplicate and print value modulo 256
` .
```

2/`     Integer divide by 172
" `
71_

```@    If the division results in 0, terminate
` `
```

The above code ended up being one of my first attempts at this method, and I only ever found a couple of others that were the same size, this one and this one, both with divisor 172. I'm not sure why this is the magic number.

Some thoughts on further golfing through this method:

  • You can push 0 through ? or { (replacing _)
  • You can push 1 through # or ,` (replacing _1)
  • The wall in the center can be anything that isn't an instruction
  • " can be replaced with ' or some other no-op and can be placed pretty much anywhere in the loop

I'm honestly not sure if this format can be golfed. It seems unlikely that there's a format that supports a smaller divisor than 172, but then again, I'm not sure why 172 was an island of stability in the first place.

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

C (gcc), 70 bytes

#define a(b)*s=#b;b
a(main(){printf("#define a(b)*s=#b;b\na(%s)",s);})

Try it online!

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

Assembly (NASM, 32-bit, Linux), 620 bytes

section .text
mov di,1
mov ebx,1
m:mov esi,a
l:mov ecx,esi
mov edx,1
mov al,[esi]
add ax,di
cmp al,10
jne p
mov ecx,b
mov dx,2
p:mov eax,4
int 128
mov al,[esi]
inc esi
cmp al,96
jne l
dec di
jz m
mov ecx,c
mov dx,3
mov ax,4
int 128
mov ax,1
int 128
section .data
c db 44,57,54
b db 92,110
a db`section .text\nmov di,1\nmov ebx,1\nm:mov esi,a\nl:mov ecx,esi\nmov edx,1\nmov al,[esi]\nadd ax,di\ncmp al,10\njne p\nmov ecx,b\nmov dx,2\np:mov eax,4\nint 128\nmov dl,[esi]\ninc esi\ncmp dl,34\njne l\ndec di\njz m\nmov ecx,c\nmov dx,3\nmov ax,4\nint 128\nmov ax,1\nint 128\nsection .data\nc db 44,57,54\nb db 92,110\na db`,96

-149 bytes by using backqoutes

-26 bytes by simplifying jumps

Try it online!

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

Swift 5, 202 bytes

While much longer than the shortest Swift submission, this has important aesthetic points for me since it avoids numerical ASCII references as well as any declarations at all, using an anonymous function, resulting in a single-statement solution.

import Foundation;({print($0+"("+String(data:try!JSONEncoder().encode($0),encoding:.utf8)!+")")})("import Foundation;({print($0+\"(\"+String(data:try!JSONEncoder().encode($0),encoding:.utf8)!+\")\")})")
\$\endgroup\$
1
  • 1
    \$\begingroup\$ Welcome to the site! \$\endgroup\$ Nov 13, 2020 at 4:38
2
\$\begingroup\$

Setanta, 254 bytes

s:="s:=?q:='\"'n:=cuid@s(0,9)o:=cuid@s(9,fad@s)scriobh(athchuir@n(\"?\",q+athchuir@(athchuir@s(\"\\\\\",\"\\\\\\\\\"))('\"','\\\\\"')+q)+o)"q:='"'n:=cuid@s(0,9)o:=cuid@s(9,fad@s)scriobh(athchuir@n("?",q+athchuir@(athchuir@s("\\","\\\\"))('"','\\"')+q)+o)

Try it here!

This was pretty long, mainly because Setanta doesn't have any string formatting builtins. Probably could still be improved.

Edit 2021/2/4: It seems that you now need to spell the function to print a value as scríobh (previously, you could use scriobh without the accent on the i). Making that fix adds 2 bytes to the solution.

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

Perl 5, 24 bytes

print<<""x2
print<<""x2

24 bytes without any options.

Try it online!

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

Perl 5, 38 bytes

$_=q{$_=q{0};s/0/$_/;say};s/0/$_/;say

Try it online!

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

Adjust, 21 bytes

`@96c$+.+O`@96c$+.+O

Try it online!

Basically just a port of the Adapt quine, but updated with Adjust's swap command ($ vs Adapt's s) and no longer implicit output

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

AWK, 56 bytes

BEGIN{printf a="BEGIN{printf a=%c%s%c,34,a,34}",34,a,34}

Try it online!

Outgolfed these two.

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

Python 3, 48 bytes

s='print(f"s={s!r};{s}")';print(f"s={s!r};{s}")

Try it online!

Python 3, 74 bytes

s=r"s=;print(f'{s[:2]}r\"{s}\"{s[2:]}')";print(f'{s[:2]}r\"{s}\"{s[2:]}')

Try it online!

First two attempts... I think this is the basic approach, just used Python's f-strings.

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

Pxem Pxem (esolang-box notation), 162 113 109 bytes.

Eventually as in meta discussion I had to change the language. The following program equals to filename with same name and empty content in original notation.

Be!?BzBc!!B+BzXXFBaBcFBzBsXXFBBaBsBtBvBmBvBcAcB-BaBsBp".e!?.z.c!!.+.zXXF.a.cF.z.sXXF..a.s.t.v.m.v.cAc.-.a.s.p

Try it online!

With comments

XX.z
# represents programs from first .m
# every dot has to be replaced with B, for example,
# because dots are syntaxically special
# append " to it
.aXX(long)".z
# essentially double entire stack
.a.eXX.z
# loop begin
.a!?.zXX.z
  # move every character to bottom
  # HOWEVER B is replaced with DOT
  # when exiting from loop, the stack will be:
  # "(original data)"(modified data)
  #
  # push dummy F if B is not top
  .a.c!!.+.zXXF.aXX.z
  # replace B with dot, and push F if F is not top
  .a.cF.z.sXXF..aXX.z
  # remove dummy
  .a.sXX.z
  # move to bottom
  .a.t.v.m.vXX.z
# get out if "
.a.cAc.-.aXX.z
# finally; discard top
.a.s.p

Previous version

  • 113 bytes: Bm!?BzBcBoBc!!B+BzXXFBaBcFBzBsXXFBBaBsBtBvBmBvBcAcB-BaBp".m!?.z.c.o.c!!.+.zXXF.a.cF.z.sXXF..a.s.t.v.m.v.cAc.-.a.p
  • 162 bytes: XXx\è\ô\Ú\î\Ú\Þ\Ú\Þ\Ú@\V\Þ``\Z\Â\Æ\Æ\Þ\è\ì\Ú\ì``\Z\è¢\Â\ì\æ\ì°\î\Æ\Æ\ô\È\Â\H\Þ°\ÂQ.t.z.m.w.m.o.m.o.m .+.o00.-.a.c.c.o.t.v.m.v00.-.tQ.a.v.s.vX.w.c.c.z.d.a.$.oX.a
\$\endgroup\$
7
  • \$\begingroup\$ This isn't a quine. It's a program that outputs its own file name. A quine would require the filename to not be important; which I'm not sure is possible in Pxem. This is like submitting a 35 byte Python solution with code exec(__file__)\n with filename print'exec(__file__)': TIO. Even though this is not in direct violation of any rules here, it clearly breaks their spirit. But what you're doing here is against the rules. \$\endgroup\$
    – Makonede
    May 29, 2021 at 21:35
  • \$\begingroup\$ @Makonede but Pxem matters filename first and content is matter if and only if .f and .e are in filename; would I just undo frilom 109-byte version to 113-byte version to remove .e? Or should have I just clarify that a Pxem program consists of filename and optionally its content? In this case I would claim that its filename is the only source code; then I would satisfy the definition of quine: produces a copy of its own source code. \$\endgroup\$
    – user100411
    May 29, 2021 at 23:32
  • \$\begingroup\$ A Pxem program may run based on filename, but that does not automatically make it need to output its code instead of its content. A quine is still a quine, no matter how a language is implemented. Remember that you can't just make it output its content, by the way. A quine has to have part of its code that encodes the entire program. And even though I originally thought this isn't breaking rules, I'm 99.9% sure this is a rule somewhere, I just can't describe it in search-friendly keywords. I'll ask TNB about this answer for their opinion, I'm highly doubtful that this is a valid answer. \$\endgroup\$
    – Makonede
    May 30, 2021 at 3:18
  • \$\begingroup\$ @Makonede; the programs output their filenames; not content. \$\endgroup\$
    – user100411
    May 30, 2021 at 3:26
  • \$\begingroup\$ Or should the 109-bytes version be represented in plain-text notation, such as in esolang-box or nk.'s text2pxem.pl? \$\endgroup\$
    – user100411
    May 30, 2021 at 22:18
2
\$\begingroup\$

Agda, 160 bytes

open import IO;open import Data.String;main = run(putStr(r ++ show r))where r ="open import IO;open import Data.String;main = run(putStr(r ++ show r))where r ="

Try it online!

Agda is an interesting Haskell-like language with some interesting ideas and a lot of imports. Luckily I've managed to avoid most of those (though my early attempts weren't so successful). The version on TIO is a bit out of date, which led to some frustration with the docs, but I think this code should still work with the latest version.

Explanation:

open import IO           -- Import the IO library for `run` and `putStr`
open import Data.String  -- Import Data.String for `++` and `show`
main = run(putStr        -- with main, print the string
       (r ++ show r))    -- r appended with the string representation of r
       where r =         -- where r is
                 "..."   -- the string of the rest of the program
\$\endgroup\$
2
\$\begingroup\$

OCaml, 66 bytes

(fun x->Printf.printf"%s%S"x x)"(fun x->Printf.printf\"%s%S\"x x)"

Try it online!

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

JsonLogic, 631

{"reduce":[[1],{"cat":[{"reduce":[{"var":"accumulator"},{"cat":[{"var":"accumulator"},{"substr":["\\\",:[]1abcdelmnorstuv{}",{"var":"current"},1]}]}]},{"var":"accumulator"},"]]}"]},[21,1,16,11,10,19,9,11,1,3,4,4,6,5,2,21,1,9,7,18,1,3,4,21,1,16,11,10,19,9,11,1,3,4,21,1,20,7,16,1,3,1,7,9,9,19,13,19,12,7,18,15,16,1,22,2,21,1,9,7,18,1,3,4,21,1,20,7,16,1,3,1,7,9,9,19,13,19,12,7,18,15,16,1,22,2,21,1,17,19,8,17,18,16,1,3,4,1,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,1,2,21,1,20,7,16,1,3,1,9,19,16,16,11,14,18,1,22,2,6,5,22,5,22,5,22,2,21,1,20,7,16,1,3,1,7,9,9,19,13,19,12,7,18,15,16,1,22,2,1,5,5,22,1,5,22,2,4]]}

Try it online by pasting it under "Rule" here. (Note: the "Output" section is JSON-encoded. The raw unquoted string is logged in the console which can be viewed with F12)

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

ErrLess, 34 24 bytes

Thanks to Jo King for saving 10 bytes

S'R1+,$:@:?.S'R1+,$:@:?.

No trailing newline.

Explanation

S'R1+,$:@:?.S { Put the rest of the program in a string: ("'R1+,$:@:?.") }
'R1+,         { Add a one-element string containing `S`: ("'R1+,$:@:?." "S") }
$:            { Swap & concatenate: ("S'R1+,$:@:?.") }
@:            { Duplicate & concatenate: ("S'R1+,$:@:?.S'R1+,$:@:?.") }
?.            { Print & halt }

ErrLess is a stack-based language I made for fun over the last few months. You can read the docs here, and I also started a tutorial.

Try it online!

\$\endgroup\$
0
2
\$\begingroup\$

OIL, 77 bytes

Quines are one of the things that aren't that hard in OIL, because of the whole "unified memory" thing. The quine exists since a long time, but I hadn't posted it here yet.

The following code needs to be stripped of the comments to work:

0  # do nothing, these two fields are just placeholders
0
1  # copy the line above to itself
1
1
4  # output line 1
1
11 # and a newline
4  # and output line 1 again
1
11 # and a newline (now we printed 0 and 0)
1  # copy line 2 to line 2
2  # *
2
1  # copy
12 # line 12 (the one marked with the star)
18 # to line 18 (marked with $)
10 # ^, if the next line (currently 2) is equal to the line afterwards (1)
18 # $
1
32 # jump to line 32 (essentially quitting, because it's out of bounds)
22 # otherwise to the next line:
1  # copy from 18 ($) to 26 (&)
18
26
4  # output from the cell with the number in the next line
26 # &
8  # increment line 18 ($)
18
11 # newline
6  # jump to line 17 (^, beginning of the loop)
17
\$\endgroup\$
2
\$\begingroup\$

Scratch, 542 bytes

when gf clicked
set[s v]to[when gf clicked/&set[s v]to[/&set[i v]to(0/&set[q v]to[/&repeat(length of(s/&change[i v]by(1/&if<<(letter(i)of(s))=[/]>and<(letter((i)+(1))of(s))=[&]>>then/&say(q/&set[q v]to[/&change[i v]by(1/&else/&set[q v]to(join(q)(letter(i)of(s/&end/&if<(i)=[28]>then/&set[q v]to(join(q)(s/&
set[i v]to(0
set[q v]to[
repeat(length of(s
change[i v]by(1
if<<(letter(i)of(s))=[/]>and<(letter((i)+(1))of(s))=[&]>>then
say(q
set[q v]to[
change[i v]by(1
else
set[q v]to(join(q)(letter(i)of(s
end
if<(i)=[28]>then
set[q v]to(join(q)(s

Try it on Scratch! (link is to a project that uses lists as output for better readability.)

This uses a classic method of storing the data in a container and uses it to make a quine. Because Scratch doesn't allow to initialize a list in just a single block, I have to use a variable of string and encode /& for a newline.

Explanation:

when gf clicked // when green flag is clicked (the start of the program)
set[s v]to[when gf clicked/&set[s v]to[/&set[i v]to(0/&set[q v]to[/&repeat(length of(s/&change[i v]by(1/&if<<(letter(i)of(s))=[/]>and<(letter((i)+(1))of(s))=[&]>>then/&say(q/&set[q v]to[/&change[i v]by(1/&else/&set[q v]to(join(q)(letter(i)of(s/&end/&if<(i)=[28]>then/&set[q v]to(join(q)(s/&
// the above variable `s` is used to store the content of the whole code, apart from the content of itself, which we'll try to tackle using the below code.
set[i v]to(0 // set the counter to 0
set[q v]to[ // this is like a buffer for what we'll say on a line
repeat(length of(s //repeat for the length of s
change[i v]by(1 // increment i by one
if<<(letter(i)of(s))=[/]>and<(letter((i)+(1))of(s))=[&]>>then // if we hit the newline
say(q // then say what is in the buffer
set[q v]to[ // clear the buffer
change[i v]by(1 // and increment i, to avoid parsing &
else /// else
set[q v]to(join(q)(letter(i)of(s //add the letter to the buffer
end // end the if-else
if<(i)=[28]>then //if we hit the 28th character, which is right after the initializion part of the variable s
set[q v]to(join(q)(s // then we add the whole content of s onto the buffer
\$\endgroup\$
6
  • \$\begingroup\$ Instead of using /&, why not use // and do <(letter(i)of(s))=(letter((i)+(1))of(s))>? \$\endgroup\$ Jun 29, 2023 at 11:08
  • \$\begingroup\$ @UndoneStudios Unfortunately letter have double t, so when the code runs it treats the double t as a newline. \$\endgroup\$
    – badatgolf
    Jun 30, 2023 at 2:05
  • \$\begingroup\$ What about using a single character that the code doesn't have (like $?) \$\endgroup\$ Jun 30, 2023 at 10:52
  • \$\begingroup\$ @UndoneStudios you also can't, because it will mistake the $ in <(letter(i)of(s))=[$]> in s as a newline. \$\endgroup\$
    – badatgolf
    Jul 1, 2023 at 2:49
  • \$\begingroup\$ We could add another condition and<not<(i)=(whatever position this $ is)>>. Probably that would work? \$\endgroup\$ Jul 3, 2023 at 10:34
2
\$\begingroup\$

RASEL, 11 bytes

<@,Yj5#?:,"
\$\endgroup\$
2
\$\begingroup\$

Thunno, \$26\log_{256}(95)\$ ≈ 21.35203072707557

bytes

"D34CXx+xs+s+"D34CXx+xs+s+

Attempt This Online!

It's one of those ones which has one of itself.

Explained

"..."D34CXx+xs+s+
"..."              # Push a literal string 
     D             # Duplicate that string
      34CX         # X = chr(34)
          x+       # append " to the string
            xs+    # prepend " to the string
               s+  # prepend that to the original literal string
\$\endgroup\$
1
2
\$\begingroup\$

Commodore C64 machine code (6502) using the Kernal (non-competing/just for fun), 42 bytes

From memory location 0x033c, enter the following machine code in your monitor:

>C:033c  a2 00 bd 3c  03 48 4a 4a  4a 4a 20 59  03 68 48 29
>C:034c  0f 20 59 03  68 cd 65 03  f0 0e e8 d0  e5 c9 0a 90
>C:035c  02 69 06 69  30 20 d2 ff  60 01

Now call with g 033c or SYS 828 from the BASIC prompt.

Each byte of the machine code is written to the screen with the CHROUT routine in the Commodore Kernal, so this will likely work with all Commodore 8-bit machines, though it is untested on all but the Commodore C64.

How it works:

The routine starts from the base address at 0x033c, and reads each byte by loading its value into the accumulator; the accumulator is pushed to the stack, and then the value is logically shifted right so to get the high nybble (so d2 becomes 0d), and the high nybble is converted to its PETSCII equivalent (0 - F inclusive) and outputted to the screen.

We pull the value back from the accumulator and then mask out the high nybble, leaving the lower nybble (so a9 will become 09) and again we convert this to its PETSCII equivalent and output it to the screen.

Finally, we check the value of the current memory location of 0x033c offset by the X register (our counter); if it is equal to our terminating byte (in this case is 01, the last byte of the quine) we're done. Otherwise, we increment our X register by 1 and go again.

For some hints, you may disassemble this by using d 033c in your monitor; this will show you the 6502 assembly equivalent to the machine code bytes.

For further guidance and reference, consult C64 Wiki or CodeBase 64.

Commodore C64 Quine

\$\endgroup\$
2
+100
\$\begingroup\$

(,), 8167 7594 7402 7242 Chars

((),()()())(((),(())()),)(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),()()()())(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),()()()())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),()()()())(((),(())()),)(((),(())()),())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),()()()())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),()()()())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),()()()())(((),(())()),)(((),(())()),())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),()()()())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),)(((),(())()),()()()())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),()()()())(((),(())()),)(((),(())()),())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),()()()())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),()()()())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),()()()())(((),(())()),)(((),(())()),())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),()()()())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),()()()())(((),(())()),)(((),(())()),())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),()()()())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),()()()())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),()()()())(((),(())()),)(((),(())()),())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),()()()())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),()()()())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),()()()())(((),(())()),)(((),(())()),())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),()()()())(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),()()()())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),())(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),()()()())(((),(())()),)(((),(())()),)(((),(())()),)(((),(())()),())(((),(())()),())(((),(())()),())(((),(())()),())((()),((()())))((),()()())(()(),(()())(())()(),,,(),,(())(())()())(,,,(()()),(),,()())(,,,(()(),,,(()())())(())())(,,,(()(),,,(()()))(),(),,(()))(,,,(()())())((,,,(()()),(),,()()())(,,,(()(),,,(()())())()()()())(,,,(()()),(),,()())(,,,(()())(),(),,()())(,,,(()()))(,,,(()())(),(),,()())(,,,(()())()()()())(,,,(()(),,,(()()))(),(),,((())))((),(())(),,(()())()),,,,((())))((),()()())((),(())(),,((()))(()()),((())))

Thanks to some golfs (and help from Dadsdy himself) now fits in a link!

I wanted to golf Dadsdy's submission but I couldn't really understand the implementation of the decoder, so I've ended up writing a new submission from scratch.

Edit: reverted one golf because the interpreter changed and broke it; I've managed to nest some print statements however, which ended up in a lower bytecount anyway!

Edit: new golf suggested by Dadsdy cuts 160 more bytes!

Explanation

A typical quine strategy, the first part encodes the second part of the code, and the second part prints the encoded version followed by the unencoded one.

I'm using the variable at address 1 (var1) as a pointer, going through the characters of the quine one by one. var2 will contain the ascii code for an open bracket ((, 40), while closed bracket (), 41) and comma (,, 44) will be printed by adding 1 and 4 respectively to that number. Variables from 3 onward will contain the encoding of the quine.

((),()()())
Set var1 to 3

((),(())())....(((),(())()),())
Encode all the code after this part: 
  (((),(())()),) is an open bracket
  (((),(())()),()) is a closed bracket
  (((),(())()),()()()()) is a comma
this sets each memory address in order to 0, 1, or 4 to match the following code.

((()),((()())))
Set the memory address after the end of the data to -1

((),()()())
Reset var1 to 3

(()(),(()())(())()(),,,(),,(())(())()())
Set var2 to 40 (5*8)

(,,,(()()),(),,()())(,,,(()(),,,(()())())(())())(,,,(()(),,,(()()))(),(),,(()))(,,,(()())())
Print ((),()()()), the first instruction of the quine which was not included in the encoded part

((,,,(()()),(),,()()())(,,,(()(),,,(()())())()()()())(,,,(()()),(),,()())(,,,(()())(),(),,()())(,,,(()()))(,,,(()())(),(),,()())(,,,(()())()()()())(,,,(()(),,,(()()))(),(),,((())))((),(())(),,(()())()),,,,((())))
For each variable in memory print the corresponding encoding
(this will print the encoded part of the quine)

((),()()())
Reset var1 to 3

((),(())(),,((()))(()()),((())))
For each variable in memory, print the corresponding character    
(this will print the unencoded part of the quine)

text = `((()),((()())))((),()()())(()(),(()())(())()(),,,(),,(())(())()())(,,,(()()),(),,()())(,,,(()(),,,(()())())(())())(,,,(()(),,,(()()))(),(),,(()))(,,,(()())())((,,,(()()),(),,()()())(,,,(()(),,,(()())())()()()())(,,,(()()),(),,()())(,,,(()())(),(),,()())(,,,(()()))(,,,(()())(),(),,()())(,,,(()())()()()())(,,,(()(),,,(()()))(),(),,((())))((),(())(),,(()())()),,,,((())))((),()()())((),(())(),,((()))(()()),((())))`;
text = text.replace("\n","").replace("\r","")
output = "((),()()())";
inc = "((),(())())"
for (let c of text){
  output += c=="(" ? `(${inc},)` : c==")" ? `(${inc},())` : `(${inc},()()()())`;
}

output += text
out1.innerHTML = output.length + " chars"
out2.innerHTML = output
<h1 id=out1></h1>
<p id=out2></p>

\$\endgroup\$
7
  • \$\begingroup\$ I cannot belive I didn't try that encoder. Edit: I did, I just didn't realize I didn't need to set it to anything \$\endgroup\$
    – Dadsdy
    Jun 26, 2023 at 23:32
  • \$\begingroup\$ For -7 Chars each, the ()(),() can be removed. This is because ungiven condition arguments default to -1. \$\endgroup\$
    – Dadsdy
    Jun 26, 2023 at 23:50
  • \$\begingroup\$ Also it turns out outputting the 40 + variable**2 and replacing (((),(())()),()()()()) with (((),(())()),()()) is worth it, as is replacing ((),(())()) with (((),(())()),), getting it down to 7645 chars. codepen.io/Onilily/pen/zYMvjMO \$\endgroup\$
    – Dadsdy
    Jun 27, 2023 at 0:04
  • \$\begingroup\$ I was sure I had tried that first golf, but apparently it got lost somewhere ^^" I'll need some time to understand your second idea though... Thanks! \$\endgroup\$
    – Leo
    Jun 27, 2023 at 3:54
  • \$\begingroup\$ Turns out that after another golf using a new flag, the first golf is no longer more efficient \$\endgroup\$
    – Dadsdy
    Jul 2, 2023 at 16:07
2
\$\begingroup\$

Thue++ 39 Bytes

.+::=~$0\n::=\n$0
::=
.+::=~$0\n::=\n$0
\$\endgroup\$
2
\$\begingroup\$

FALSE, 34 39 bytes

["$91,34,!34,93,!"]$91,34,!34,93,!

Try it online!

This is a "standard" quine program as outlined here: https://esolangs.org/wiki/Quine. What makes this program interesting is its use of FALSE's lambda ([]) command. FALSE doesn't have string literals, so I had to make an anonymous lambda function that prints a string, rather than returning it's value. This can then be executed multiple times by duping it ($).

\$\endgroup\$
1
10 11
12
13 14
16

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.