(?!)
It counts up, multiplies and prints. It never counts down, so every letter starts again from 0.
MadMax, 2019 · Turing complete: no · ●○○ easy · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
MadMax made (?!) in 2019. It has one accumulator, a whole number that starts at 0, and the only thing a program can do with it is print characters. Its commands add 1, multiply, print and reset, and there is no input.
Read the story
Counting up to the 72 of an H one step at a time takes 72 question marks. A loop multiplies instead, so ???????(??????????)?? is 7 times 10 plus 2, which is 72. After each letter (!) sets the accumulator back to 0 for the next one.
The machine
| Command | Does |
|---|---|
? | Add 1 |
! | Print the character with the accumulator's code |
( ... ) | Multiply by what the body counts |
(!) | Set the accumulator to 0 |
A loop's body holds only ? and other loops. The specification shows only flat loops. A body counts from 0, each ? adding 1 and each inner loop multiplying the count by its own, so (??(???)) multiplies by 6. Spaces, tabs and line breaks may stand between commands but not inside a loop, as the specification's grammar has it.
Example
The first program writes every letter as a product and a little more.
The first program writes every letter as a product and a little more. E is 13 times 5 plus 4, and the space is 10 times 3 plus 2. The second program prints H as 8 times 9 and i as 10 times 10 plus 5.
Patterns it teaches
- Encoding tricks: a number written as a product and a remainder takes far fewer symbols than counting to it.
Further
See also
Also in Turing tarpits
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: u28-3f-21-29.
Command line
shib run u28-3f-21-29 -e '???????(??????????)??!'shib manual u28-3f-21-29Source
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/u28-3f-21-29.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org