Skip to content

Commit

Permalink
docs(brainfuck): improve instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
MSilva95 committed Nov 22, 2024
1 parent 422aff5 commit dd53a47
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions subjects/brainfuck/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ The source code will be given as the first parameter, and will always be valid w
Your `Brainfuck` interpreter will consist of an array of 2048 bytes, all initialized to 0, with a pointer to the first byte.

Every operator consists of a single character:

- `>`: increment the pointer.
- `<`: decrement the pointer.
- `+`: increment the pointed byte.
- `-`: decrement the pointed byte.
- `.`: print the pointed byte to the standard output.
- `[`: if the pointed byte is 0, then instead of moving onto the next command, skip to the command after the matching `]`.
- `]`: if the pointed byte is **not** 0, then instead of moving onto the next command, move back to the command after the matching `[`.

Any other character is a comment.
- `.`: print the pointed byte to standard output.
- `[`: If the byte at the current pointer is 0, skip forward to the command after the matching `]`.
- `]`: If the byte at the current pointer is not 0, jump back to the command after the matching `[`.
- Any other character is treated as a comment and ignored.

### Usage

Expand Down

0 comments on commit dd53a47

Please sign in to comment.