$!
One byte and two commands. The only output is that byte as a number, at the end of every line.
TheCanon2, 2024 · Turing complete: no · ●○○ easy · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
TheCanon2 made $! in 2024. All of its memory is one 8-bit cell. $ shifts the cell one bit to the left and ! flips its rightmost bit, so a number is spelled out in binary from its top bit down. There is no character output, so Hello, World! prints the codes of its letters instead, one number per line.
Read the story
The cell is never cleared. Each line goes on from the value the line before left, and eight shifts in a row always empty it, as every bit falls off the top.
The machine
| Command | Does |
|---|---|
$ | Shift the byte one bit left; the top bit falls off |
! | Flip the lowest bit |
| end of a line | Print the byte as a decimal number |
Every other character does nothing. As in the specification's Python interpreter, the last line counts as ended too, and a line that reads eof ends the program.
Example
The XKCD random number.
The XKCD random number. ! makes 1 and two shifts make 4.
Hello, World!. The second line starts from 72 and has to turn it into 101, and the empty fourth line prints 108 a second time.
Patterns it teaches
- Every text runs: any text is a program, as only
$,!and line ends do anything. - Encoding tricks: every number is written out bit by bit, top bit first.
Further
See also
Accumulator-based
Write your own in Run Convert a program from $!
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: u24-21.
Command line
shib run u24-21 -e '!$$'shib manual u24-21Source
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/u24-21.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org