path
Section: PATH Programming Language (1)
Updated: February 2004
Index
NAME
path - PATH programming language
SYNOPSIS
path [ -dhn ] [ -p
dir
]
file ...
DESCRIPTION
PATH is a unique two-dimensional programming language. Unlike conventional programming languages, which read a program in left-to-right, top-to-bottom, PATH programs can go up, down, left, and right, and change directions at will. The capabilities of the language can also be extended through the use of plugins.
OPTIONS
- -d --debug
-
Print out extra information about program execution to stderr.
- -h --help
-
Display a help screen and quit.
- -n --noplugins
-
Don't load any plugins.
- -p dir --plugindir dir
-
Load plugins from the directory dir instead of the default location.
FILES
/usr/lib/path/
-
System-wide directory for PATH plugins. Plugins for all users go here.
~/.path/
-
User-specific directory for PATH plugins. Individual users may place plugins here.
LANGUAGE REFERENCE
A PATH program has only a minimal environment to run: an array of unlimited integers ("memory cells"), and standard input and output. The program can input and/or ouput ASCII values from the cells, increment/decrement cells, seek between different cells, and branch off in different directions if the current cell is not equal to 0.
The PATH interpreter starts at the first "$" character in the program file and starts heading right, reading every character (or
instruction symbol
) in its way. The interpreter behaves accordingly when it encounters one of these valid instruction symbols:
$
- Start the program here, heading right.
#
- End the program.
+
- Increment the current memory cell.
-
- Decrement the current memory cell.
}
- Move to the next memory cell.
{
- Move to the previous memory cell.
,
- 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.
If the PATH interpreter does not understand a symbol, it simply passes over it without taking any action. Plugins may also add additional symbols with extra functionality.
AUTHOR
Francis Rogers <exorcismtongs AT users DOT sf DOT net>
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- OPTIONS
-
- FILES
-
- LANGUAGE REFERENCE
-
- AUTHOR
-
This document was created by
man2html,
using the manual pages (and tweaked by francis).
Time: 00:37:47 GMT, February 25, 2004