dopey — Another Brainf*ck Interpreter
Dopey is a Brainf*ck interpreter written in Python. It fully supports the Brainf*ck language as defined in the Wikipedia specification.
Features
- Full Brainf*ck command support:
+ - > < [ ] , . - 30,000-cell memory tape initialized to zero
- Bounded pointer with runtime safety checks
- Importable Python module for embedding in scripts
- Simple CLI interface to execute
.bffiles
Limitations
- The memory buffer is fixed at 30,000 byte cells.
- Pointer underflow or overflow raises a
MemoryException. - Printing values outside the ASCII range may raise encoding errors depending on your terminal.
Requirements
Python 3 is required. You can install it from python.org.
To verify installation:
python --version
# or
python3 --version
Installation
Install Dopey using pip:
pip install dopey
To run a Brainf*ck file:
python -m dopey path/to/program.bf
Using in Your Python Code
You can also use Dopey as a module:
from dopey import Interpreter
interpreter = Interpreter()
interpreter.execute("++[>++<-]>.")
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you'd like to change.
License
Languages
Python
86.9%
Brainfuck
13.1%
