# Track

Track is a two-dimensional esoteric programming language made by User:Wh1teWolf. It has a two-dimensional instruction area of 30x? instruction cells, and a one-dimensional memory array,

## Commands

Character What it does
`>` Set the “walking” direction to right.
`<` Set the “walking” direction to left.
`^` Set the “walking” direction to up.
`V` Set the “walking” direction to down.
`@` Set the “walking” direction depending on the number under the pointer: 1 = right, 2 = left, 3 = down, 4 = up, otherwise = right.
`+` Increment the cell under the pointer by one.
`-` Decrement the cell under the pointer by one.
`.` Output the ASCII character associated with the value in the cell under the pointer.
`:` Output the numeric stored in the cell under the pointer.
`,` Input an ASCII character and store it in the cell under the pointer.
`;` Input a number and store it in the cell under the pointer.
`0``9` Move the memory pointer to the cell n.

## Examples

### Infinite loop

```V<
>^
```

This program shows how the “walking” direction stuff works. The first instruction is `V`, making the program move down to the next line where there is a `>` instruction, this changes the “walking” direction to right. We go right one step where there is a `^` and are pointed up to the `<` instruction, this makes us go left to the starting point and so on...

```,.
```

### Counting from 1 to 10 (looping counter)

```V               V       <
>1++++++++++++++>1-0+:1@^
```

This example could also be written like this (which is the best way of doing it):

```++++++++++++++>0-1+:0@V
^       <
```

### 99 bottles of beer

```3++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++
+++++++++++++++++0
+++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++
++++++++++++

2++++++++++++++++++++++++++++
++++0

V                           0<
>:2.1++++++++++++++++++++++++
+++++++++++++++++++++++++++++
+++++++++++++.+++++++++++++.+
++++..--------.-------.++++++
++++++++.2.1----.---------.2.
1----.+++..+++++++++++++.2.1-
--.-.2.1++++++.------------.-
--.2.1++++++++++++++++++.----
------------------.++++++++++
+..2++++++++++++.------------
.0:2.1----------.++++++++++++
+.+++++..--------.-------.+++
+++++++++++.2.1----.---------
.2.1----.+++..+++++++++++++.2
++++++++++++++.--------------
4++++++++++.1++.-------------
------.++++++++++.------.2.1+
+++++++++.-.---------.2.1-.++
+++++++++.++++++++.---------.
2.1++.---------------.+++++++
+++++++++++..2.1----------.++
+++++++++.2.1----------------
---.+++++++++++++++++.---.+++
+++.-------.----------.2+++++
+++++++.------------.0-:2.1--
.+++++++++++++.+++++..-------
-.-------.++++++++++++++.2.1-
---.---------.2.1----.+++..++
+++++++++++.2.1---.-.2.1+++++
+.------------.---.2.1+++++++
+++++++++++.-----------------
-----.+++++++++++..2+++++++++
+++++.--------------4..------
----1------------------------
-----------------------------
-----------------------
V>V<
>3-@                         ^
```

## Interpreter

• Common Lisp implementation of the Track programming language.