dd
One instruction. It prints itself.
A, 2018 · Turing complete: no · ●○○ easy · esolangs.org
Tested with 4 known programs · Test method
Run it
The idea
User A published dd on 4 July 2018. It has one instruction, dd, and that instruction prints dd. Everything else does nothing. So any program made only of dd is a quine, and almost any text is a dd program, which the specification offers as a way to write polyglots.
Read the story
There is no input, no memory and no jump. esolangs.org files it under finite state automata.
The machine
| Text | Does |
|---|---|
dd | Print dd |
| anything else | Nothing |
The JavaScript reads from left to right and uses both d of a pair, so ddd holds one pair and prints dd, not dddd. A line break between two d keeps them apart.
Example
The longer example has four pairs.
The longer example has four pairs. The fifth would be the last two d, but a line break stands between them.
Patterns it teaches
Further
See also
Also in Jokes
Write your own in Run Convert a program from dd
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: dd.
Command line
shib run dd -e 'dd'shib manual ddSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/dd.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org