Brainfuckest
Brainfuck written as a sum, with one character per term.
2022 · Turing complete: yes · ●○○ easy · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
Brainfuckest writes brainfuck with 69 characters, the digits, the letters in keyboard order, the space and six punctuation marks, but no brackets. A program is read as one number, and that number in base 8 is the brainfuck program. Each octal digit is one command.
Read the story
The number grows only with the square of the program's length. A brainfuck program of 10 commands needs at least 1,972 characters, one of 20 commands at least 64,631,663. Most brainfuck programs, Hello World among them, would need more characters than could ever be written down.
The machine
The characters 0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM ,.?!;: stand for 0 to 68 in that order, with the space after M. Each character gives its number plus 69 times its position, counting from 0, and the sum is written in base 8.
| Digit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|---|
| Brainfuck | > | < | + | - | . | , | [ | ] |
qwerty gives 10, 80, 150, 220, 290 and 360, which add up to 1,110. That is 2126 in base 8, or +<+[, an error, since its bracket never closes. The brainfuck underneath has 30,000 byte cells that wrap, and , gives 0 at the end of the input.
Example
The cat is 26 Z, each worth 55.
The cat is 26 Z, each worth 55. They add up to 23,855, which is 56457 in base 8, the brainfuck cat ,[.,]. The second program follows from the rules. :, ? and 0 are worth 68, 65 and 0, so the sum is 68 + 134 + 138 = 340, which is 524 in base 8, or ,+.. It reads a character and prints the next one.
Patterns it teaches
- Encoding tricks: the program is one number in disguise.
- Turing completeness: it stands for brainfuck, though most programs are far too long to write.
Further
See also
Brainfuckest builds on Brainfuck.
Brainfuck derivatives
Write your own in Run Convert a program from Brainfuckest
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: brainfuckest.
Command line
shib run brainfuckest -e 'ZZZZZZZZZZZZZZZZZZZZZZZZZZ' --input 'abc'shib manual brainfuckestSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/brainfuckest.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org