diff --git a/README.md b/README.md new file mode 100644 index 0000000..69d28c2 --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# bf-debugger +An interactive brainfuck executor and debugger. It allows setting memory and code breakpoints, step a number of times, view the memory state and output. + +![screenshot](demo.png) + +## usage +Specify a source file and optionally an input file: +``` +brainfuck path/to/program.bf [path/to/input.txt] +``` +### Code breakpoints: +The `!` character will be treated as a breakpoint, stopping execution + +### Command list: +`[brackets]` are optional parameters. +- `step [n]` + - Step the progam n times (this is the default behavior when pressing enter with no command) +- `run` + - Run the program until the end +- `watch ` + - Create a breakpoint. Execution will stop when has +- `quit` | `q` | `exit` + - Exit the debugger diff --git a/demo.png b/demo.png new file mode 100644 index 0000000..5e7933b Binary files /dev/null and b/demo.png differ diff --git a/src/main.rs b/src/main.rs index 04be58d..4ce3151 100644 --- a/src/main.rs +++ b/src/main.rs @@ -171,7 +171,7 @@ impl BFInterpreter { } println!(); println!("{:?}. steps: {}", self.state, self.steps); - println!("output: {}", String::from_utf8_lossy(&self.output)); + println!("output: {}", String::from_utf8_lossy(&self.output).blue()); // println!("input: {}", String::from_utf8_lossy(&self.input)); }