Crates.io | brainpreter |
lib.rs | brainpreter |
version | 0.1.0 |
source | src |
created_at | 2017-11-10 23:00:33.45946 |
updated_at | 2017-11-10 23:00:33.45946 |
description | A simple and easy to use brainfuck interpreter. |
homepage | |
repository | https://github.com/DimChtz/brainfuck/tree/master/rust-brainpreter |
max_upload_size | |
id | 38924 |
size | 19,590 |
A simple and easy to use Brainfuck interpreter.
let mut bf = brainpreter::Inter::new();
// For file use: .load_from_file()
match bf.load("++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.") {
Ok(_) => {}
Err(e) => println!("{}", e),
}
match bf.parse() {
Ok(_) => {}
Err(e) => println!("{}", e),
}
match bf.run() {
Ok(_) => {}
Err(e) => println!("{}", e),
}
Hello world!
Add this line to your Cargo.toml:
[dependencies]
brainpreter = "0.1.0"
and then add this line to your main.rs:
extern crate brainpreter;