6 bytes of useless element
Drop the first character, put an f in its place, and print. Every program that starts with f is a quine.
Yayimhere, 2024 · Turing complete: no · ●○○ easy · esolangs.org
Tested with 4 known programs · Test method
Run it
The idea
Yayimhere made 6 bytes of useless element in 2024, after 3 bytes :v). The whole language is one rule. The program's first character is dropped, and an f is printed in its place before the rest of the program.
Read the story
So any text that starts with f prints itself, and any other text prints itself with an f for its first letter. The specification lists interpreters in eleven other languages, from brainfuck and Python to Momema and Scratch.
The machine
There is one step. The program xabc prints fabc, and the empty program prints f. Nothing is read.
The brainfuck interpreter shows the rule in 20 characters. --[----->+<]>. prints f, ,, reads the first two characters, and [.,] prints from the second one on.
Example
The Hello world starts with a space, which becomes the f.
The Hello world starts with a space, which becomes the f. The last one is a polyglot with Brachylog. It answers false.
Patterns it teaches
- Quine: a quine for free, if it starts with f.
- Every text runs: any text is a program and prints something.
See also
Also in Jokes
Write your own in Run Convert a program from 6 bytes of useless element
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: 6-bytes-of-useless-element.
Command line
shib run 6-bytes-of-useless-element -e 'f'shib manual 6-bytes-of-useless-elementSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/6-bytes-of-useless-element.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org