https://github.com/mrmaxguns/maxbf
A bulletproof Brainfuck interpreter in C
https://github.com/mrmaxguns/maxbf
brainfuck brainfuck-interpreter c cmake freesoftware interpreter
Last synced: 29 days ago
JSON representation
A bulletproof Brainfuck interpreter in C
- Host: GitHub
- URL: https://github.com/mrmaxguns/maxbf
- Owner: mrmaxguns
- License: gpl-3.0
- Created: 2023-01-11T15:32:07.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-06T19:13:42.000Z (over 3 years ago)
- Last Synced: 2025-02-27T15:46:00.280Z (over 1 year ago)
- Topics: brainfuck, brainfuck-interpreter, c, cmake, freesoftware, interpreter
- Language: C
- Homepage:
- Size: 81.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MaxBF
A bulletproof, tested, Brainfuck interpreter written in C.
## Specification
For full documentation, see [DOCUMENTATION.md](DOCUMENTATION.md).
- Defined commands are `>`, `<`, `+`, `-`, `.`, `,`, `[` and `]`. All other characters
are ignored.
- The array for data (tape) is dynamically allocated, and therefore extends 'infinitely'
to the right (as long as more memory can be allocated). Going backwards from the first
cell causes an error.
- Each cell is implemented as an unsigned character, and is guaranteed to be one bit. This
means 8 bytes on most systems.
- Jump instructions `[` and `]` must be properly nested or the interpreter exits with an
error.
- If an EOF is encountered during input, the cell is set to 0.
## Build and run
The program is configured to be built by CMake. It is written in one file using
standard C99 and can therefore be compiled by any spec-compliant compiler.
Build and install MaxBF:
```sh
cmake -S . -B build
cmake --build build
cmake --build build --target install
```
Run MaxBF:
```sh
maxbf FILE
```
See complete instructions at [DOCUMENTATION.md](DOCUMENTATION.md#compilation).
## Test
With CMake:
```
ctest
```
Or with the generated Makefile:
```
make test
```
## License
MaxBF is distributed as free software under the GNU GPL V3 license.