brainpreter 0.1.0

A simple and easy to use brainfuck interpreter.
Documentation
  • Coverage
  • 0%
    0 out of 7 items documented0 out of 6 items with examples
  • Size
  • Source code size: 19.22 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.65 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • DimChtz

rust-brainpreter (brainpreter) - v0.1.0

A simple and easy to use Brainfuck interpreter.

How to use (Hello world! Example)

Create a new brainpreter.

let mut bf = brainpreter::Inter::new();

Load brainfuck code from text string or file.

// For file use: .load_from_file()
match bf.load("++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.") {

    Ok(_) => {}
	
    Err(e) => println!("{}", e),
	
}

Compile the bf code.

match bf.parse() {
        
    Ok(_) => {}
	
    Err(e) => println!("{}", e),

}

Finally run it.

match bf.run() {
        
    Ok(_) => {}
	
    Err(e) => println!("{}", e),

}

Result on the console.

Hello world!

Installation

Add this line to your Cargo.toml:

[dependencies]

brainpreter = "0.1.0"

and then add this line to your main.rs:

extern crate brainpreter;