Instruction Set
Command | Effect |
---|---|
> | Move data pointer right |
< | Move data pointer left |
+ | Increment cell |
- | Decrement cell |
. | Output cell as ASCII |
, | Input one byte |
[ | Jump forward past matching ] if cell is 0 |
] | Jump back to matching [ if cell is non-zero |
Turing Completeness in 8 Symbols
Despite (or thanks to) its spartan design, Brainfuck is Turing-complete. Any computable function can be expressed using just these eight commands.
Runner Controls
- Paste or type Brainfuck code in the editor.
- Run: execute to completion (with safety limit).
- Step: execute one instruction at a time to observe tape changes.
- Reset: clears tape and output.
The visualiser shows the first 50 cells of the tape in real time. Consult games/js/demos.js
for the interpreter.