[−][src]Module iaith::brainf
A brainf*ck implementation.
As described on the EsoLang wiki.
Brainf*ck operates on an array of memory cells, each initially set to zero. There is a pointer, initially pointing at the first memory cell. The language contains the following commands.
Command | Description |
---|---|
> | Move the pointer to the right |
< | Move the pointer to the left |
+ | Increment the memory cell at the pointer |
- | Decrement the memory cell at the pointer |
. | Output the character signified by the cell at the pointer |
, | Input a character and store it in the cell at the pointer (Not yet implemted) |
[ | Jump past the matching ] if the cell at the pointer is 0 |
] | Jump back to the matching [ if the cell at the pointer is non-zero |
All other characters are considered comments.
Structs
Program | A container for all the state needed to execute a brainf*ck program. |
Enums
State | Used to represent the state the program is in. |
Token | Represents a valid control character in a brainf*ck program. |