diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -1,4 +1,19 @@ | |||
1 | brainfuck | 1 | brainfuck |
2 | ========= | 2 | ========= |
3 | 3 | ||
4 | brainfuck | 4 | Brainfuck is represented by an array with 30,000 cells initialized to zero |
5 | and a data pointer pointing at the current cell. | ||
6 | |||
7 | There are eight commands: | ||
8 | ``` | ||
9 | + : Increments the value at the current cell by one. | ||
10 | - : Decrements the value at the current cell by one. | ||
11 | > : Moves the data pointer to the next cell (cell on the right). | ||
12 | < : Moves the data pointer to the previous cell (cell on the left). | ||
13 | . : Prints the ASCII value at the current cell (i.e. 65 = 'A'). | ||
14 | , : Reads a single input character into the current cell. | ||
15 | [ : If the value at the current cell is zero, skips to the corresponding ] . | ||
16 | Otherwise, move to the next instruction. | ||
17 | ] : If the value at the current cell is zero, move to the next instruction. | ||
18 | Otherwise, move backwards in the instructions to the corresponding [ . | ||
19 | ``` \ No newline at end of file | ||