If(j)invert()if(l)change()if(q)input()if(t)output(x);
Four letters do something. Every other character prints itself.
2014 · Turing complete: no · ●○○ easy · esolangs.org
Tested with 8 known programs · Test method
Run it
The idea
The name is the whole manual. j inverts, l changes cell, q reads input and t outputs. There are two cells and no loops, so a program runs once from left to right. Every other character prints itself, which makes any text without those four letters a quine. The FizzBuzz is the list from 1 to 100.
Read the story
Without input a cell only holds 0 or 1, and t prints a cell as a character. So the Hello World writes 1 in place of l, or asks the user for the l. Input is read as a number, as in the Java interpreter, so the user types 108, the code of l.
The machine
| Char | Does |
|---|---|
j | Set the cell to 1 if it is 0, else to 0 |
l | Move to the other cell |
q | Read a whole number into the cell |
t | Print the cell as a character |
| anything else | Print itself |
Example
The first is one of the Hello Worlds with commands mixed in.
The first is one of the Hello Worlds with commands mixed in. The two l after He swap the cells twice, and the j and l in the middle flip a cell and move on. None of them print. The second reads 108 once and prints it three times as l. The third is one round of the second cat, which reads two numbers into the two cells and prints both.
Patterns it teaches
- Every text runs: any text is a program, and most text prints itself.
- Quine: a text without j, l, q and t is its own output.
See also
Also in Jokes
Write your own in Run Convert a program from If(j)invert()if(l)change()if(q)input()if(t)output(x);
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: if-j-invert-if-l-change-if-q-input-if-t-output-x.
Command line
shib run if-j-invert-if-l-change-if-q-input-if-t-output-x -e 'qtqtqt' --input '72 105 33'shib manual if-j-invert-if-l-change-if-q-input-if-t-output-xSource
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org