Key Concepts
- Code lives on a 2-D toroidal grid (80×25 in the original spec).
- An instruction pointer (IP) moves in one of four cardinal directions executing the character under it.
- The program can push numbers onto a stack, perform arithmetic, branch by changing the IP direction, and even self-modify the grid.
Common Instructions
Char | Meaning |
---|---|
> | IP right |
< | IP left |
^ | IP up |
v | IP down |
+ ,- ,* ,/ ,% | Arithmetic on stack |
_ | Pop value; IP left if non-zero else right |
| | Pop value; IP up if non-zero else down |
@ | End program |
Using the Runner
- Type or paste a 2-D program into the grid textarea.
- Run executes to completion (with a max step count safeguard).
- Step advances one instruction to watch the IP roam.
- Reset clears the grid and output.
Self-modifying behaviour is fully supported by writing into the grid with the p
/g
instructions. Peek at games/js/demos.js
for implementation details.