3D Brain Fuck (henceforth referred to as 3DBF for simplicity) is a variant of brainfuck in which not only the array of cells is in a 3-dimensional grid, but also the placement of blocks.
The code itself is not 3D though, as will be explained in the next chapter.
Details
In standard implementations, array cell values loop at 0 & 255.
Both types of cells are arranged in the corresponding grid.
The size of arrays is dynamic in standard implementations
Terminology
- Blocks are code that can be placed inside of a cell.
- The grid is a standard cube grid with each cube holding a cell.
- The array grid is a standard grid with each cube holding an array cell.
- Cells are areas where a singular block can be placed.
- An array cell is a singular variable inside of the array grid that can be manipulated.
Code
Regular blocks
| Block
|
Description
|
+
|
Increment the memory cell at the array pointer
|
-
|
Decrement the memory cell at the array pointer
|
.
|
Output the character signified by the cell at the array pointer
|
,
|
Input a character and store it in the cell at the array pointer
|
[
|
Jump past the matching ] if the cell at the array pointer is 0
|
]
|
Jump back to the matching [ if the cell at the array pointer is nonzero
|
Movement of the Instruction Pointer
| Block
|
Description
|
N
|
Starts the instruction pointer in a +X
|
S
|
Starts the instruction pointer in a -X
|
E
|
Starts the instruction pointer in a +Z
|
W
|
Starts the instruction pointer in a -Z
|
U
|
Starts the instruction pointer in a +Y
|
D
|
Starts the instruction pointer in a -Y
|
Movement of the memory pointer
Basically the same, except uncapitalised.
| Block
|
Description
|
n
|
Moves the array pointer in a +X
|
s
|
Moves the array pointer in a -X
|
e
|
Moves the array pointer in a +Z
|
w
|
Moves the array pointer in a -Z
|
u
|
Moves the array pointer in a +Y
|
d
|
Moves the array pointer in a -Y
|
Movement of block generation
| Block
|
Description
|
^
|
Starts the generation pointer in a +X
|
_
|
Starts the generation pointer in a -X
|
>
|
Starts the generation pointer in a +Z
|
<
|
Starts the generation pointer in a -Z
|
"
|
Starts the generation pointer in a +Y
|
'
|
Starts the generation pointer in a -Y
|