Browse Source

docs(brainfuck) correct grammar

pull/1183/head
davhojt 2 years ago committed by Dav Hojt
parent
commit
ebab4a3f8c
  1. 28
      subjects/brainfuck/README.md

28
subjects/brainfuck/README.md

@ -1,21 +1,23 @@
## brainfuck
> Esoteric programming languages (esolang) are designed to test the boundaries of computer programming design, as proofs of concept, as software art, as a hacking interface or simply as a joke. One such esoteric language is `Brainfuck`. It was created by Urban Müller in 1993. It is a minimalist language consisting of 8 simple commands. It is Turing complete, but is not intended for practical use. It exists to amuse and challenge programmers.
### Instructions
Write a `Brainfuck` interpreter program.
The source code will be given as first parameter.
The code will always be valid, with less than 4096 operations.
`Brainfuck` is a minimalist language. It consists of an array of bytes (in this exercice 2048 bytes) all initialized with zero, and with a pointer to its 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 on standard output
- '[' go to the matching ']' if the pointed byte is 0 (loop start)
- ']' go to the matching '[' if the pointed byte is not 0 (loop end)
The source code will be given as the first parameter, and will always be valid with fewer than 4096 operations.
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.

Loading…
Cancel
Save