PATH programming language
Encyclopedia : P : PA : PAT : PATH programming language
PATH is an esoteric programming language derived from the brainfuck language. Programs are arranged on a two-dimensional grid in a manner similar to the language Befunge. Slash and backslash characters are used to direct program flow up, down, left, and right, and "arrow" characters are used to branch program flow. Data is stored in an array of integers called "memory cells", a concept also borrowed from brainfuck.
Sample code
The following code causes the computer terminal to beep by outputting the ASCII character 0x07 (BEL).
/*****\ /*+*\ /!*/*!\ \ # ! + // \\ * * * /**$**/ * * * * . * +-----+ + +-----+ * * * * * * \ / \ / \ /
Instructions in PATH
$ | Start at this position, heading right |
# | End program execution |
+ | Increment the current memory cell by one |
- | Decrement the current memory cell by one |
} | Change to the next memory cell |
{ | Change to the previous memory cell |
, | Input a character and store the ASCII value in the current memory cell |
. | Output the character with the ASCII value in the current memory cell |
/ |
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 |
! | Skip over the next character |
See also
- SNUSP programming language simplified Path, with a call stack
- 2L programming language: based loosely on PATH and Brainfuck, but has only two symbols.
- esoteric programming language
External links
- [The official PATH website]
- [A PATH interpreter written in PHP]
- [A PATH (and SNUSP) interpreter and library written in C#]
From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.
