= = = PRISMATIC = = =
A Turing Complete Esoteric Programming Language
By Jack Eisenmann

Prismatic Code

Prismatic State
X Dimension:
0
Y Dimension:
0
Z Dimension:
0

= = = DESCRIPTION = = =

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.

rightIncrease X dimension by 1.
forwardIncrease Y dimension by 1.
upIncrease Z dimension by 1.
leftDecrease X dimension by 1 unless the X dimension is 0.
backwardDecrease Y dimension by 1 unless the Y dimension is 0.
downDecrease Z dimension by 1 unless the Z dimension is 0.
widthBegin branch if X dimension is greater than 0.
lengthBegin branch if Y dimension is greater than 0.
heightBegin branch if Z dimension is greater than 0.
widenessLoop branch while X dimension is greater than 0.
longessLoop branch while Y dimension is greater than 0.
tallnessLoop branch while Z dimension is greater than 0.
vertexEnd branch.

Commands are separated by whitespace. Comments in programs are preceded by @ and appear on their own line.

= = = EXAMPLES = = =

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
= = = PROOF OF TURING COMPLETENESS = = =

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.

Return to the Ostracod Pond