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