54 lines
1.8 KiB
Markdown
54 lines
1.8 KiB
Markdown
# dopey - Another Brainf*ck Interpreter
|
|
[](https://lgtm.com/projects/g/gio101046/dopey/alerts/)
|
|
[](https://lgtm.com/projects/g/gio101046/dopey/context:python)
|
|
|
|
Dopey is a brainf\*ck interpreter. It fully implements all the features of brainf\*ck as defined [here](https://en.wikipedia.org/wiki/Brainfuck#Language_design).
|
|
|
|
## Demo
|
|

|
|
|
|
## Implemetation Limitations
|
|
|
|
Dopey is limited to a memory buffer of **30,000** byte cells all initialized to zero. Any attempts to move the pointer past the bounds of the memory buffer will result in an exception being raised. Attempting to print any cell with a value outside of the defined ASCII characters may also result in an exception.
|
|
|
|
## Requirements
|
|
|
|
Make sure you've installed Python 3. You can download and install Python 3 at [python.org](https://www.python.org/downloads/).
|
|
|
|
Verify you have Python 3 installed by running the following:
|
|
|
|
```bash
|
|
python --version
|
|
```
|
|
or in some systems
|
|
```bash
|
|
python3 --version
|
|
```
|
|
|
|
## Installing
|
|
|
|
You can install dopey using `pip`. From the command line:
|
|
|
|
```bash
|
|
# use pip python package manager to install dopey
|
|
$ pip install dopey
|
|
|
|
# run dopey using python
|
|
$ python -m dopey my-bf-file.bf
|
|
```
|
|
|
|
You can also import an interpreter class included with dopey and use it in your own python scripts.
|
|
|
|
```python
|
|
from dopey import Interpreter
|
|
|
|
interpreter = Interpreter()
|
|
interpreter.execute("[brainf*ck code]++-->><<++--")
|
|
```
|
|
|
|
## Contributing
|
|
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
|
|
|
|
## License
|
|
[MIT](https://choosealicense.com/licenses/mit/)
|