rainfuck

Crates.iorainfuck
lib.rsrainfuck
version1.0.0
sourcesrc
created_at2024-01-20 10:16:22.403399
updated_at2024-01-20 10:16:22.403399
descriptionA configurable, powerful, zero-dependency Brainfuck interpreter!
homepage
repositoryhttps://gitlab.com/oglo-crates/rainfuck
max_upload_size
id1106391
size16,134
Jackson Novak (Oglo12)

documentation

README

Rainfuck

A configurable, minimal, powerful Brainfuck interpreter library! Rainfuck uses no dependencies unless you specify a feature that requires one!

Examples:

use rainfuck::BrainfuckVM;

// A simple cat program. (Just repeats what you type.)
fn main() {
    let mut vm = BrainfuckVM::new();
    vm.prompt_display = String::from("[TYPE]: ");

    vm.process(",[.,]");
}
use rainfuck::BrainfuckVM;

// Run some stuff, then reset the virtual machine.
fn main() {
    let mut vm = BrainfuckVM::new();
    assert!(vm == BrainfuckVM::new());

    vm.process("++++++++[>+>+<<-]>>[<<+>>-]");
    assert!(vm.cells[0..4] == [8, 8, 0, 0]);

    vm.reset();
    assert!(vm == BrainfuckVM::new());
}
Commit count: 0

cargo fmt