create README

This commit is contained in:
Crispy 2024-09-09 20:28:48 +02:00
parent d658d1fcb9
commit b350c06459
3 changed files with 24 additions and 1 deletions

23
README.md Normal file
View file

@ -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 <cell> <value>`
- Create a breakpoint. Execution will stop when <cell> has <value>
- `quit` | `q` | `exit`
- Exit the debugger

BIN
demo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View file

@ -171,7 +171,7 @@ impl BFInterpreter {
} }
println!(); println!();
println!("{:?}. steps: {}", self.state, self.steps); 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)); // println!("input: {}", String::from_utf8_lossy(&self.input));
} }