- Simple Brainfuck REPL interpreter in Python
- Here are some sample programs:
$ ./brainfuck_repl.py
Brainfuck REPL intepreter in Python!
> ++
Tape dump: [0, 0, 2, 0, 0]
> ,[>+<--]>.
b
1
Tape dump: [0, 0, 0, 49, 0]
>
With DEBUG_STEP
enabled, it can also display step-by-step execution:
$ ./brainfuck_repl.py --debug-step
Brainfuck REPL intepreter in Python!
> [this will add input char by one],+.
#1
Tape: [0, 0, -> 0, 0, 0]
Code: [this will add input char by one],+.
^
#2
Tape: [0, 0, -> 0, 0, 0]
Code: [this will add input char by one],+.
^
a
#3
Tape: [0, 0, -> 97, 0, 0]
Code: [this will add input char by one],+.
^
#4
Tape: [0, 0, -> 98, 0, 0]
Code: [this will add input char by one],+.
^
b
Tape dump: [0, 0, 98, 0, 0]
>