Skip to content

charliethomson/brainfrsck

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 

brainfrsck

A brainfrick interpreter written in safe rust

Usage

The main entry point is the eval_string function

Example

use brainfrsck::prelude::eval_string;

let hello_world = "++++++++[>++++[>++>+++>++
+>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++
.>>.<-.<.+++.------.--------.>>+.>++.";

assert_eq!(
    eval_string(hello_world, None)?.to_string(),
    "Hello World!\n".to_owned(),
);

Notes

  • eval_string returns an InterpreterOutput which is essentially a wrapper for a Vec<u8>, it has methods to convert to a String (to_string) and to get the internal Vec (to_vec), as well as Debug writing the Vec and Display writing the String

About

A needlessly complex brainfrick interpreter written in safe rust

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages