diff --git a/readme.md b/readme.md index 6983073..33209b6 100644 --- a/readme.md +++ b/readme.md @@ -3,3 +3,14 @@ This is a simpel brainfuck interpeter written in rust. It has 2 modes, classic (default) and visualised. +## Usage + +```sh +brainfuck-interpeter +``` +You can leave out mode, it defaults to `classic`. +You can also put `visualised` there to get a live memory map and slowed down execution + +## Example + +![](https://stikosek.xyz/files/bfgif.gif) \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 5cd43ca..808157c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -279,8 +279,17 @@ fn main() { let mut program: Program = Program::build(contents); - //program.run(); - program.diagnostic_run(); + // Run based on mode of operation + let arguments: Vec = env::args().collect(); + if arguments.len() > 2 { + if arguments[2] == "visualised" { + program.diagnostic_run(); + }else{ + program.run(); + } + }else{ + program.run(); + } } fn clear_term() {