QuineFuck
Brainfuck where the comments speak. Any text without a command in it is a quine.
None1 · Turing complete: yes · ●○○ easy · esolangs.org
Tested with 4 known programs · Test method
Run it
The idea
None1 made QuineFuck from brainfuck with one change. Brainfuck skips every character that is not one of its eight commands. QuineFuck prints it instead, at the moment the program reaches it. So Hello World! prints itself, and so does any other text that avoids +-<>.,[]. The specification lists two quines, Quine and Fuck!.
The machine
| Char | Does |
|---|---|
> < | Move the pointer right or left |
+ - | Add or take 1 from the cell |
. , | Print the cell; read a byte into it |
[ ] | Loop while the cell is not 0 |
| anything else | Print itself |
The specification's interpreter is in Python. Cells are bytes, the tape reaches both ways and the end of input reads as 0. It reads its input with one input(), so a program sees one line.
Example
The last one prints 5 = as text, then counts 7 times 7 plus 4 into a cell, which is 53, the code of 5.
The last one prints 5 = as text, then counts 7 times 7 plus 4 into a cell, which is 53, the code of 5.
Patterns it teaches
- Quine: here a quine needs no trick at all.
- Every text runs: any text is a program, and most of it is output.
Further
- esolangs.org/wiki/QuineFuck
- Brainfuck, the language underneath
See also
QuineFuck builds on Brainfuck.
Brainfuck derivatives
Write your own in Run Convert a program from QuineFuck
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: quinefuck.
Command line
shib run quinefuck -e 'Quine'shib manual quinefuckSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/quinefuck.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org