Stones

The stones esoteric programming language is a language in which colored stones are moved around a hypothetical field, created by User:Zackh in late 2016 to early 2017.

Operations in stones are carried out by specifying which stone to move where by how much, e.g.;

red up two red down three yellow left

=Specification=

Comments in stones are defined as anything not in the following list of keywords:



Statements
Statements in stones follow the following structure:

color direction [one, two, or three]

A magnitude will only be supplied if  is   or.

Instructions
stones instructions are executed according to the following table:

When a  program is initiated, the field is arranged in a 6x12 grid paddern:

blue-- -- -- -- -- -- orange -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- red--- -- -- -- -- -- green- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- yellow -- -- -- -- -- purple -- -- -- -- -- -- -- -- -- -- -- -- --

After a command is executed, for example, the field is updated with the new position of red.

blue-- -- -- -- -- -- orange -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- green- -- -- -- -- -- red--- -- -- -- -- -- -- -- -- -- -- -- -- -- yellow -- -- -- -- -- purple -- -- -- -- -- -- -- -- -- -- -- -- --

In stones, stones routinely run in to each other. This can produce different effects. If the stone that it runs into is heavier than that stone, the instruction of the stone movement will not occur. If the stone it runs into is lighter than that stone, the stone it runs into will be moved out of the way, its instruction will be executed, and then the first stone will be moved and its instruction executed.

In the table above, the stones colors are ranked from lightest to heaviest, with red being the lightest and purple being the heaviest.

=Examples=

A Truth-machine in :

blue down               get user input green down              duplicate input red up one              push zero orange up two           check if equal purple up               if true red up one blue up             output 0 and terminate purple down             otherwise red up one          move Red to another row green left          drop result red left three      push true purple left         while true red down one    push one blue up         print one red left three  push true red right three move Red out of the way red up one green left      drop results green left purple right       end while purple right           end if

This small program produces the following output for 1:

11111111111111111111111...

Turing-completeness
Ignoring the stack size limitations and side effects of stones running in to each other is (probably) enough to prove Turing-completeness.

However, due to the side effects of stones running in to each other, Turing-completeness of  is unknown.

Interpreter
An interpreter can be found at the following pages:


 * Binary form
 * Script form