This is a simple Brainfuck interpreter written in Rust. This is my first attempt at using Rust. The CI tests will fail
for as long as std::ops::RangeInclusive
is only in the nightly build.
To aim is to implement a Brainfuck interpreter that has 2^16 cells with 2^8 possible states each. Characters that do not map to any instruction will be ignored. Please note that the Brainfuck code is treated as ASCII and exotic unicode characters will probably break the interpreter.
Since this is a normal crate you can simply do cargo build
.
Like any crate: cargo test
Use brainfuck-rs run <BF_FILE>
to execute a Brainfuck file. The demo
directory contains some basic Brainfuck demos.
To run them directly from cargo you can do cargo run -- <BF_FILE>
. This will execute the program from the repository
root.