Six instruction language :)
Three registers that count to 15, six digits to set them, and one sum as the only output.
2022 · Turing complete: no · ●○○ easy · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
Six instruction language :) is from 2022, and its specification begins by saying it is the author's first language. It has three registers that each hold a number from 0 to 15. Six digits set, add, wipe and invert them. There is no input and no loop, so every program runs once from left to right and stops. What is in the third register at the end is the output.
Read the story
Arguments are not written as numbers. Each value from 0 to 15 has a letter, in this order a b c q w e d f g r t y h i j u. So 1e sets the first register to 5.
The machine
| Digit | Does |
|---|---|
1 2 | Set r1 or r2 to the letter after it |
3 | Set r3 to r1 plus r2 |
4 | Wipe r3 |
5 | Wipe r1 and r2 |
6 | Set r1 to 15 minus r1 |
A sum above 15 wraps modulo 16, so 9 plus 9 gives 2. The specification does not say what it does.
Example
The 1+1.
The 1+1. b is 1, so both registers get 1 and the third gets their sum.
The state inversion sets r1 to 5 and turns it into 15 minus 5. 3 then copies it into r3, as r2 is still 0.
See also
Also in Jokes
Write your own in Run Convert a program from Six instruction language :)
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: six-instruction-language.
Command line
shib run six-instruction-language -e '1e63'shib manual six-instruction-languageSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/six-instruction-language.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org