From f80f252eb0a19e92ba021aa5d99796466191886f Mon Sep 17 00:00:00 2001 From: b1ek Date: Tue, 22 Aug 2023 17:45:31 +1000 Subject: [PATCH] add README.md --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..08da6a8 --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ +# BrainRustFucked +YABI (Yet Another Brainfuck Interpretator) +This is designed to embed BrainFuck for applications. + +This library provides 2 functions: + +```rs + +/** + * Eval the code from a raw string returning the memory + */ +fn eval(bf_str: &&str) -> Result<[u8; 30000], String> + +/** + * A more low level function to run code in custom environment + * This is useful when you want to use presetted memory & pointer + */ +fn eval_mem(bf_str: &&str, mem: &mut [u8], pointer: &mut usize) -> Result<(), String> +``` + +Example code: +```rs +// print "Hello world!" +eval("++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.").unwrap(); +``` + +Also check out `examples/` directory \ No newline at end of file