A brainfrick interpreter written in safe rust
The main entry point is the eval_string
function
use brainfrsck::prelude::eval_string;
let hello_world = "++++++++[>++++[>++>+++>++
+>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++
.>>.<-.<.+++.------.--------.>>+.>++.";
assert_eq!(
eval_string(hello_world, None)?.to_string(),
"Hello World!\n".to_owned(),
);
eval_string
returns anInterpreterOutput
which is essentially a wrapper for aVec<u8>
, it has methods to convert to aString
(to_string
) and to get the internalVec
(to_vec
), as well asDebug
writing theVec
andDisplay
writing theString