207
\$\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\$
  • 4
    \$\begingroup\$ Do you not mean, "Golf you a quine for greater good!"? \$\endgroup\$ – Mateen Ulhaq May 3 '11 at 2:49
  • 55
    \$\begingroup\$ @muntoo it's a play on "Learn you a Haskell for Great Good". \$\endgroup\$ – Rafe Kettler May 3 '11 at 2:52

365 Answers 365

1
9 10 11
12
13
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.
```
| improve this answer | |
\$\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.

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

Perl 5 + -p, 35 bytes

A fishy quine!

}{s<><}{s<><@>;s<@><lc>e>;s<@><lc>e

Try it online!

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ I can somewhat get the other quines, but somehow Perl always manages to elude me. \$\endgroup\$ – Razetime Sep 17 at 5:42
  • 1
    \$\begingroup\$ @Razetime This particular one is a little tricky because it breaks out of the (implicit) while(<>){...} from -p first and then uses nesting chars for s/// (s<><> in this quine) and uses @ as a positional argument (like %s in the printfstyle quines). The final piece is using lc for a reference to $_ as everything would be unchanged by lowercasing. If I get time today I'll annotate this one properly too! \$\endgroup\$ – Dom Hastings Sep 17 at 6:04
1
\$\begingroup\$

Integral, 18 12 Bytes

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

Try it not on TIO!

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

Perl 5, 21 bytes

say<<""x2
say<<""x2


Try it online!

| improve this answer | |
\$\endgroup\$
1
\$\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
| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

memes, 2 bytes

The 3 is irrelevant, as in, any digit apart from 0 could be used.

-3

Any mathematical token followed by a digit without anything infront will get interpreted as 0+x, as an example. Therefore -3 will result in 0-3, which returns -3.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Note simply 3 works too, but that is too much of an obvious reading-from-the-source. \$\endgroup\$ – devRicher Dec 26 '16 at 22:33
  • 1
    \$\begingroup\$ This answer does not appear to be a proper quine, meaning that it is invalid, and therefore subject to deletion. \$\endgroup\$ – pppery Sep 18 at 1:42
1
\$\begingroup\$

2sable, 10 bytes

44186D15B

Try it online!

This uses the same strategy as its parent language 05AB1E, but beats it by not having to join afterwards.

Explanation

44186      Push 44186
     D     Duplicate
      15B  Convert to base 15
           Implicitly print the stack
| improve this answer | |
\$\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
| improve this answer | |
\$\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
| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ I should write a SEDE query to see how many of the 362 quines you've written. \$\endgroup\$ – Razetime Sep 19 at 17:00
  • \$\begingroup\$ @Razetime A search for inquestion:69 user:76162 currently puts it at 32 \$\endgroup\$ – Jo King 2 days ago
  • \$\begingroup\$ 8% of all the answers. I'm waiting for the day 50% comes. \$\endgroup\$ – Razetime 2 days ago
1
\$\begingroup\$

Acc!!, 270 bytes

936025123570680582070742833115365117904492153588422750562053064415808293823109091171562255866020953926270476903421472061856963432351191541604543106801928196867870451324872393884426634
Count a while a-183 {
Write 48+(_/10^(182-a))%10
}
Count b while _ {
Write _%128
_/128

Try it online!

Explanation

...                          Set the accumulator to a large number
Count a while a-183 {        Loop from 0 to 182
Write 48+(_/10^(182-a))%10   Print the ath digit of the number
}
Count b while _ {            Loop while the accumulator is not zero
Write _%128                  Print the character of the accumulator modulo 128
_/128                        Integer divide the accumulator by 128
| improve this answer | |
\$\endgroup\$
1
\$\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
| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ Bloody hell, I had no idea Adapt was actually usable, that's super cool! \$\endgroup\$ – caird coinheringaahing yesterday
0
\$\begingroup\$

Ada, 274 258 257 Characters

with Text_IO;use Text_IO;procedure Q is M:Character:='"';T:String:="with Text_IO;use Text_IO;procedure Q is M:Character:=';T:String:=;begin Put_Line(T(1..54)&M&T(54..65)&M&T&M&T(66..126));end Q;";begin Put_Line(T(1..54)&M&T(54..65)&M&T&M&T(66..126));end Q;

pretty printed:

with Text_IO;
use Text_IO;
procedure Quine is
   M : Character := '"';
   T : String := "with Text_IO;use Text_IO;" &
     "procedure Q is M:Character:=';T:String:=;" &
     "begin Put_Line(T(1..54)&M&T(54..65)&M&T&M&T(66..126));end Q;";
begin
   Put_Line(T(1..54)&M&T(54..65)&M&T&M&T(66..126));
end Quine;

this program actually produces the short version (output can be redirected to q.adb).

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

Pretty certain you can't get shorter than this with Common Lisp. The first one I managed to figure out myself; all credit to http://rosettacode.org/wiki/Quine#Common_Lisp for the second one.

Common Lisp - 9 (With REPL)

(write -)

In Common Lisp, - is a special variable that holds the expression currently being evaluated but only during a read-eval-print loop. If you're running from a script or you've disabled the REPL though...

Common Lisp - 25 (No REPL)

#1=(write '#1# :circle t)

This references itself and then prints itself out. :circle t makes it detect the infinite recursion cycle and exit early.

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

CJam, 1 byte

Note: CJam was made after this challenge was posted, I am posting this answer as documentation as opposed to a serious entry.

0

Pushes a 0 to the stack, and CJam automatically outputs the stack after program execution.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Don't forget newlines. \$\endgroup\$ – CalculatorFeline May 28 '17 at 1:39
  • 2
    \$\begingroup\$ One part of the program does not encode another, so this program is invalid \$\endgroup\$ – MilkyWay90 Feb 5 '19 at 18:04
0
\$\begingroup\$

ForceLang with this module, 87 bytes

Noncompeting, language postdates the challenge

set j require njs
j var f=function(){print("set j require njs\nj var f="+f+";f()")};f()
| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

Idris, 88 bytes

q:String;main:IO();main=putStr$q++show q;q="q:String;main:IO();main=putStr$q++show q;q="

It’s like Haskell with more enforced top-level type signatures. I had to put q’s type first, because Idris’s type checker is a little weird? I dunno.

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

Forth (gforth), 21 bytes

: x
latest name-see ;

This prints the decompiled source of the latest word, thus only works if x is the latest defined word.

Test:

x 
: x  
latest name-see ; ok

This one works without that condition, but replaces the constant definition with it's value (since that's the only thing that actually gets saved to memory)

: x
[ latest ] literal name-see ;

Test:

x 
: x  
  140121195205104 name-see ; ok
| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ If it prints with a newline in the middle, but the original doesn't have it, it's not a quine. \$\endgroup\$ – Pavel Dec 29 '16 at 5:07
  • \$\begingroup\$ Fixed. It's because there's no way to tell where spaces/newlines are as it's only compiled code \$\endgroup\$ – 2xsaiko Dec 29 '16 at 13:39
  • \$\begingroup\$ It's not a proper quine anyway, because it reads its own source. \$\endgroup\$ – mbomb007 May 10 '17 at 14:02
0
\$\begingroup\$

Pyke, 14 bytes

"34.Cp\D\Es"DE

Try it here!

"34.Cp\D\Es"   - "34.Cp\D\Es"
            DE - eval(^, stack=^)

 34.C          -   '"'
     p         -  print(^)
      \D\Es    - sum("34.Cp\D\Es", ^, "D", "E")
| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

SimpleTemplate, 56 bytes

This is a template engine language I've made for fun.

It was written in PHP and run by compiling the weird syntax to PHP.

This answer is a translation of Aurel Bílý's amazing PHP answer!

{@setF"{@setF%c%s%c}{@printF,34,F,34}"}{@printF,34,F,34}

Weird, right?

This works with the commit d1d3e2c43bd98da2bd38f884ee5ac7b39cb8c579 on my Github and you can try it on http://sandbox.onlinephpfunctions.com/code/cca9ed3b9c87abad61159725f159285e5daf9bb9.

In there, you will have the existing code on that commit, plus showing the result and the generated PHP.

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

R, 47 bytes

f=function(){cat('f=');print(f);cat('f()')}
f()

Try it online!

Can be extended to contain any set of operations by adding those before the first cat statement.

Printing a function f returns the content of that function starting with function(){. I then added cat statements to handle the rest of the output.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ should probably be 53 bytes, as print will add indentation and weird brackets placement. \$\endgroup\$ – Giuseppe Jan 25 '18 at 15:41
  • \$\begingroup\$ @Giuseppe hmm, on TIO there also appears to be trailing spaces. If counting those we'd end up at 64 bytes \$\endgroup\$ – JAD Jan 25 '18 at 16:36
  • \$\begingroup\$ :| too long \$\endgroup\$ – ASCII-only May 13 '18 at 10:37
  • \$\begingroup\$ Alhough TIO adds spaces and newlines, my local install does not. The same thing occurs with my 44 byte answer. I haven't found which option is different between the two installs. Also, I accidentally downvoted your answer instead of upvoting it, and my vote is now locked. Sorry about that. If you edit your answer, I'll change my vote. \$\endgroup\$ – Robin Ryder Aug 4 at 15:29
0
\$\begingroup\$

GNU Make, 52 51 11 bytes

$(value $0)

When called as a function, returns its source code.

And here's a complete makefile that doesn't return its code, but rather prints it:

Q=$(info Q=$(value Q))$(info $$(call Q))
$(call Q)

Explanation

The second line just instantiates the variable, the first one defines it:

$(info Q=$(value Q))$(info $$(call Q))
         $(value Q)                     # Get unexpanded value
                           $$           # "$" escaped
$(info Q=          )$(info   (call Q))  # Print the remaining parts
| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

Babel, 161 bytes

{ "{ '{ ' << dup [val 0x22 0xffffff00 ] dup <- << << -> << ' ' << << ' }' << } !" { '{ ' << dup [val 0x22 0xffffff00 ] dup <- << << -> << ' ' << << '}' << } ! }%
| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

Ceylon, 173 154 bytes

Saved those bytes thanks to Challenger5

shared void run(){print(let(x="""shared void run(){print(let(x=$)x.replaceFirst("$","\"\"\""+x+"\"\"\""));}""")x.replaceFirst("$","\"\"\""+x+"\"\"\""));}

source

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ You can golf off some whitespace. Try it online! \$\endgroup\$ – Esolanging Fruit May 25 '17 at 1:07
  • \$\begingroup\$ @Challenger5 Cheers :D \$\endgroup\$ – MD XF May 25 '17 at 1:10
0
\$\begingroup\$

Conway's Game of Life, 7 bytes

!
**
**

Uses Plaintext format.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ 5 bytes, you missed the newline. Alternatively, in Standard Plaintext: **\n** \$\endgroup\$ – CalculatorFeline May 27 '17 at 23:30
  • \$\begingroup\$ @CalculatorFeline Thanks, edited. \$\endgroup\$ – MD XF May 28 '17 at 0:23
  • \$\begingroup\$ What interpreter are you running this in? \$\endgroup\$ – Wheat Wizard May 28 '17 at 20:50
  • \$\begingroup\$ @WheatWizard This is not necessarily run in an interpreter, it simply means "a 2x2 square of live cells in an empty grid". \$\endgroup\$ – MD XF May 28 '17 at 21:16
  • 2
    \$\begingroup\$ -1 this method of IO is very limited \$\endgroup\$ – ASCII-only Aug 28 '17 at 2:31
0
\$\begingroup\$

ColdFusion, 276 bytes

<cfset u=Chr(34)><cfset q="<cfset u=Chr(34)><cfset q=%s%s%s><cfoutput>%screateObject(%sjava%s,%sjava.lang.String%s).format(q,[u,q,u,Chr(35),u,u,u,u,Chr(35)])%s</cfoutput>"><cfoutput>#createObject("java","java.lang.String").format(q,[u,q,u,Chr(35),u,u,u,u,Chr(35)])#</cfoutput>

I've never used ColdFusion, but after seeing @Danninta's post on Self-growing code codee codeee codeeee I thought I'd play around. This could almost certainly be golfed down by someone that actually knows the language, so feel free to add a new answer.

Tested locally on lucee-express-5.2.6.60

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

Jstx, 4 bytes

£↕26

Try it online!

| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ You might want to include an explanation, I'd be interested! Also I believe you'll need to include a newline in your code since the output of this program seems to include one as well. \$\endgroup\$ – ბიმო Apr 10 '18 at 16:34
  • 1
    \$\begingroup\$ I assume you are the created of Jstx and the GitHub? In your documentation you mention all the possible commands/operations/functions, but not which character represents it. Since I couldn't find it in the documentation, what commands/operators/functions do these £ and represent? \$\endgroup\$ – Kevin Cruijssen Apr 20 '18 at 12:03
  • \$\begingroup\$ It's not a solid association between opcodes and bytes, and it changes from version to version of the interpreter and compiler. In fact some opcodes can actually remap every opcode to byte association at runtime. Fortunately you don't need to worry about which bytes correspond to which instructions because all the programming is done directly through instructions using the Jstx compiler, then the resulting bytes can be interpreted with the same version of the Jstx interpreter. \$\endgroup\$ – Quantum64 Apr 21 '18 at 16:53
0
\$\begingroup\$

PHP, 147 bytes

<?php $c= <<<'s'
	$n='<?php $c= <<<\'s\''."\n";global $c;echo($n.$c."\ns;\n".'$e=create_function("",$c);$e();');
s;
$e=create_function("",$c);$e();

Try it online!

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

VBA, 77 bytes

An anonymous VBE immediate window quine.

c=Chr(34):q="c=Chr(34):q=:?Replace(q,Chr(7),c+q+c)":?Replace(q,Chr(7),c+q+c)
| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

Ahead, 8 bytes

"34 8ko@

Try it online!

| improve this answer | |
\$\endgroup\$
1
9 10 11
12
13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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