Write a Quine in Plain English
><>, 25 words + (22 + 11 + 11) extra = 57 49
Oh god, my brain.
'brr3deep*clap6beep+orb5flap*leap4deep+clap5beep5flap*leap9deep9clap*beep+flap0placed apple alp0leap=clip?lob8blip*flip0clip.
Since the rules state "There is no input.", for this program to work you'll need to pipe in an empty file.
Oh and yes, brr
is a valid Scrabble word, as are tsktsk
and pfft
.
Explanation
First of all, the following words are no-ops:
deep clap beep flap leap clip blip flip
This is because of two reasons:
abcdefl
push numbers (10, 11, 12, 13, 14, 15 and the length of the stack respectively). In addition,i
pushes -1 if EOF is met, seeing as there is no input.- The
p
command pops three charsv,y,x
and placesv
at the positionx,y
.
Yes, ><> lets you modify the source code on the fly! We don't really make use of that though, as we only need the p
for popping.
If we get rid of these no-ops, we get:
'brr3*6+orb5*4+55*99*+0placed apple alp0=?lob8*0.
In a similar way, the laced app
part of placed apple
and the e alp
part of apple alp
are also no-ops, and the rr
of brr
just reverses the stack twice, which we can also remove:
'b3*6+orb5*4+55*99*+0pl0=?lob8*0.
Finally, something that looks like a regular ><> program! The idea is to make use of the standard ><> quine, which works like so:
- The initial
'
starts string parsing, pushing every char met until we hit another'
- We keep pushing chars until the end of the line, at which point we wrap the instruction pointer back to the start (since ><> is toroidal)
- We land on the initial
'
again, and stop string parsing. The result is that we've pushed every single char in the program (except the initial'
) onto the stack.
Then the following happens:
b3*6+o Print the initial ' quote (ASCII 39)
r Reverse the stack
b5*4+ Push a ';' (ASCII 59)
55*99*+0p Replace the 'l' of 'lob' with ';'
(print loop)
l0=?; If the stack is empty, terminate. Otherwise...
o Print the top of the stack
b8*0. Jump back to the beginning of the loop
golfscript, 8 words + 8 symbols = 20 16 (3?)
{four"words.written~twice"four}words.written~twice
The words are just a filler, the core is a tiny quine core:
{".~"}.~
Duplicates and evaluates a function that just appends the instructions to duplicate and evaluate itself. When a function is printed, it is stringified automatically. This is the smallest quine that does something.
Or we could just use a function literal that never gets evaluated. But it feels like cheating...
{whatever}
Chicken, 1 word
I'm not normally into esolangs, but this one seemed perfect for this. I think this is a true quine:
chicken
Pushes 1 chicken to the stack. The stack is then displayed.