This repository contains a Brainfuck interpreter written in Zig. It allows you to run Brainfuck code, a programming language with eight commands.
I've been trying to run some more complicated Brainfuck programs and the interpreter is facing issues. Have gotten stuck with debugging and will revisit later. Seems to run pretty basic programs that don't involve complex loops though.
- Interpret and execute Brainfuck code.
- Handle dynamic memory allocation for Brainfuck's tape.
- Input and output operations as specified by Brainfuck's design.
- Install Zig on your system.
To build the interpreter, run the following command in the root of the project:
zig build-exe src/main.zig
To run a Brainfuck program, use the executable generated from the build process:
./main < path/to/your/brainfuck_program.bf
Or you can directly input the Brainfuck code:
echo "++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>." | ./main
Contributions are welcome! If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.
This project is licensed under the MIT License.