Brainmulti
Brainfuck with its tape folded out into three dimensions.
2023 · Turing complete: yes · ●●○ moderate · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
Brainmulti is brainfuck with its memory in three dimensions, from 2023. The pointer can go north and south, west and east, up and down, so the two moves of brainfuck become six and the eight commands become twelve.
Read the story
The specification also writes each move as brainfuck on a flat tape, 18 cells for north, 7 for west and 2 for up, and admits that this has bugs. This implementation uses a truly three-dimensional space, and no two places share a cell.
The machine
| Command | Does |
|---|---|
> < | Move north or south |
^ v | Move west or east |
o O | Move up or down |
+ - | Add or take 1 |
. , | Print the cell; read a byte into it |
[ ] | Brainfuck's loop |
Cells are bytes that wrap. Every other character is a comment, but the letters v, o and O are commands, so words in a program have to do without them.
Example
The first is a Kiwiscript program.
The first is a Kiwiscript program. It builds 100 in the cell to the east, adds 7 for the k, then moves the value back west for i, w and i.
The second is a truth machine. It prints its input, then takes 2 off it on every turn while it counts the turns in the cell above. On 0 the 48 reaches 0 after 24 turns and the run stops. On 1 the 49 never reaches 0. On the 256th turn the counter above wraps to 0, the pointer drops back onto the input inside [.], and that prints 1 forever.
The 66666666 box, ++++++[>+^+<+o+>+v+<+O-]++++++, prints nothing. It leaves a 6 in each of the eight cells of a box two cells wide, deep and high.
Patterns it teaches
- Turing tarpit: brainfuck's commands, with the tape spread over three dimensions.
Further
See also
Brainmulti builds on Brainfuck.
Multi-dimensional languages
Brainfuck derivatives
Write your own in Run Convert a program from Brainmulti
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: brainmulti.
Command line
shib run brainmulti -e ',.[--o+[oo]O[.]OO]' --input '0'shib manual brainmultiSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/brainmulti.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org