Language Specification

Background
Brainfuck is an esoteric programming language created in 1993 by Urban Müller. The language contains only eight simple commands and an instruction pointer. While it is fully Turing-complete, it is not intended for practical use, but to challenge and amuse programmers.

Diagram
--------------------||---||--------
| 0 | 0 | 0 | 0 | 0 || 0 || 0 | 0 |
--------------------||---||--------
tape ---^     ^        ^
cell ---------|        |
head (pointer) --------|

Memory Layout
The brainfuck tape is made of an infinite (in the bot's case limited to 30,000) collection of 1 byte cells. Each cell represents a single, unsigned 8-bit number. Cells start initialized at zero.
Since the numbers are unsigned, there is no need for any complex integer implementation. If the upper limit of the cell is reached, it wraps back to zero. If zero is decremented, it must wrap back to 11111111.

Instructions
< - Move the pointer right
> - Move the pointer left
+ - Increment the current cell
- - Decrement the current cell
. - Output the value of the current cell
, - Replace the value of the current cell with input
[ - Jump to the matching  ] instruction if the value of the current cell is zero
] - Jump to the matching [ instruction if the value of the current cell is not zero

Notes
- The . operator stores the output in a list which is sent to the channel at the end of execution.
- To prevent the bot hanging, execution time is limited to 30 seconds and will be cancelled if this limit is exceeded.

Example Usage


Shortcuts