Crates.io | rainfuck |
lib.rs | rainfuck |
version | 1.0.0 |
source | src |
created_at | 2024-01-20 10:16:22.403399 |
updated_at | 2024-01-20 10:16:22.403399 |
description | A configurable, powerful, zero-dependency Brainfuck interpreter! |
homepage | |
repository | https://gitlab.com/oglo-crates/rainfuck |
max_upload_size | |
id | 1106391 |
size | 16,134 |
A configurable, minimal, powerful Brainfuck interpreter library! Rainfuck uses no dependencies unless you specify a feature that requires one!
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());
}