breakfast

Crates.iobreakfast
lib.rsbreakfast
version0.1.4
created_at2025-04-18 09:54:23.225371+00
updated_at2025-06-01 08:07:45.964235+00
descriptionA Brainfuck interpreter in Rust
homepage
repository
max_upload_size
id1639142
size7,838
Xu Xiangwei (xngwei)

documentation

README

The Breakfast Brainfuck Interpreter

Breakfast is a minimal brainfuck (BF for short) interpreter in Rust.

It offers most of the suggested BF features, including multiple EOF behaviors and # for debug purposes.

Example

Here is a simple piece of code to run the “Hello World” BF program:

use breakfast::*;

fn main() -> std::io::Result<()> {
    let program = Breakfast::parse(
        r#"
            >++++++++[<+++++++++>-]<.
            >++++[<+++++++>-]<+.
            +++++++..
            +++.
            >>++++++[<+++++++>-]<++.
            ------------.
            >++++++[<+++++++++>-]<+.
            <.
            +++.
            ------.
            --------.
            >>>++++[<++++++++>-]<+.
        "#
    );

    let mut bf = Breakfast::new(Default::default());
    bf.run(program)?;

    Ok(())
}
Commit count: 0

cargo fmt