SeMo-PATH

From Esolang
Jump to navigation Jump to search

SeMo-PATH, is derivation of PATH, that is a two-dimensional language inspired by Brainfuck and Befunge. Unlike PATH's environment, SeMo-PATH's consists of a 2D plane of memory cells all initialized to zero, on which is also written the program itself, and character-based standard input and output. PATH understands the following commands:

Command Explanation
$
Start the program here, heading right.
#
End the program.
+
Increment the current memory cell.
-
Decrement the current memory cell.
}
Move to the memory cell rightwards.
{
Move to the memory cell leftwards.
V
Move to the memory cell downwards.
A
Move to the memory cell upwards.
,
Input an ASCII character from standard input into the current memory cell.
.
Output an ASCII character from the current memory cell into standard output.
/

If heading in direction:

right, turn up
down, turn left
left, turn down
up, turn right
\

If heading in direction:

right, turn down
down, turn right
left, turn up
up, turn left
^
If the value of the current memory cell is not 0, turn up.
<
If the value of the current memory cell is not 0, turn left.
>
If the value of the current memory cell is not 0, turn right.
v
If the value of the current memory cell is not 0, turn down.
!
Jump over the next symbol.

As in Brainfuck, any character not understood as a command is simply skipped over.

Computational Class

As any PATH program is also a SeMo-PATH program, and PATH is Turing complete, so SeMo-PATH is Turing also complete.