The memory of a Prismatic program is defined by the dimensions of a rectangular prism. The three dimensions are named X, Y, and Z. Prism dimensions can be any non-negative integer.
Prismatic has 13 symbols corresponding to 13 commands.
right | Increase X dimension by 1. |
forward | Increase Y dimension by 1. |
up | Increase Z dimension by 1. |
left | Decrease X dimension by 1 unless the X dimension is 0. |
backward | Decrease Y dimension by 1 unless the Y dimension is 0. |
down | Decrease Z dimension by 1 unless the Z dimension is 0. |
width | Begin branch if X dimension is greater than 0. |
length | Begin branch if Y dimension is greater than 0. |
height | Begin branch if Z dimension is greater than 0. |
wideness | Loop branch while X dimension is greater than 0. |
longess | Loop branch while Y dimension is greater than 0. |
tallness | Loop branch while Z dimension is greater than 0. |
vertex | End branch. |
Commands are separated by whitespace. Comments in programs are preceded by @ and appear on their own line.
Copy from one location to another:
right right right right right wideness left forward up vertex longness backward right vertex
Double a number:
forward forward forward forward forward forward forward longness backward up up vertex
Divide by two and get remainder:
up up up up up up up up up tallness down right height left down forward vertex vertex
A Minsky machine with 2 registers and the following instructions is known to be Turing complete:
Prismatic can easily simulate such a Minsky machine. Let the X and Y dimensions represent two Minsky registers. Commands right and forward would increment the registers, while left and backward decrement the registers. The Z dimension would serve as a scratchpad.
To conditionally jump forward:
[commands] [width or length] [commands] vertex [commands]
To conditionally jump backward:
[commands] up tallness [commands] up [width or length] tallness down vertex vertex vertex [commands]
Because Prismatic can simulate a Turing complete system, Prismatic is also Turing complete.