5D Brainfuck With Multiverse Time Travel
|Dimensions||Five-dimensional (in spirit)|
|Computational class||Turing complete|
Like brainfuck, 5D Brainfuck With Multiverse Time Travel operates on an array of memory cells initialized to zero. Multiple pointers to memory, and to the program, may coexist in each timeline. The state of the tape is stored as a timeline, allowing programs to rewind time. In addition, programs may create and traverse parallel universes, which are timelines that all execute simultaneously, "below" their parent timeline. Each timeline has its own pointer.
The following graphic demonstrates the behavior of parallel timelines. Note that this does not include time travel, as that would make the graphic impossible to read.
main timeline split -------------------+----------------------------------------------> | split 2nd timeline dies 2nd timeline +-------+-----------X /------------------------> | / 3rd timeline replaces 2nd 3rd timeline +-----------/
Once the main timeline halts (by running out of instructions to run), all other timelines are killed.
Programs consist of single-character instructions, as follows:
||Move all memory pointers in this timeline 1 cell to the right.|
||Move all memory pointers in this timeline pointer 1 cell to the left.|
||Increment all cells pointed to in this timeline.|
||Decrement all cells pointed to in this timeline.|
||Output a character for all cells pointed to in this timeline.|
||Input a character and store it in all cells pointed to in this timeline.|
||Move this instruction pointer to the matching |
||Move this instruction pointer back to the matching |
||Rewind the current tape back in time by 1 step.|
||Spawn a parallel timeline below the current timeline, with a copy of the tape and all pointers in it. This instruction pointer jumps to the matching |
||If this is executed outside of the main timeline, kill this timeline and all the memory/instruction pointers currently in it. Otherwise, do nothing.|
||Move all memory pointers in this timeline to the same location in the next ("lower") parallel universe.|
||Move all memory pointers in this timeline to the same location in the previous ("higher") parallel universe.|
It is not necessary for
() braces to be matched with each other, as long as each opening brace matches with its own closing brace. This means that
[(]) is valid syntax, and so is
Yes, the language is not strictly five-dimensional.
The program's cell count, wrapping behavior, cell size, and behavior upon input reaching EoF are implementation-dependent.
Race conditions caused by simultaneous instructions are undefined, and implementation-dependent.
Being an extension to brainfuck, the language is trivially Turing complete.
Double the amount of pointers in this timeline
Rewind time until the current cell is 0
Cat, but faster
Undefined behavior time
Two instruction pointers??