https://github.com/jochasinga/py-brainfuck
Simple Brainfuck interpreter written in Python
https://github.com/jochasinga/py-brainfuck
brainfuck interpreter python toy-compiler
Last synced: 10 months ago
JSON representation
Simple Brainfuck interpreter written in Python
- Host: GitHub
- URL: https://github.com/jochasinga/py-brainfuck
- Owner: jochasinga
- Created: 2017-09-15T07:42:58.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-15T07:43:42.000Z (over 8 years ago)
- Last Synced: 2025-07-25T07:10:19.591Z (10 months ago)
- Topics: brainfuck, interpreter, python, toy-compiler
- Language: Python
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# brainfuck
A simple [Brainfuck](1) interpreter written in Python.
## setup
No deps. Just python >= 2.7.9 is required.
## usage
Run as a command line tool
```shell
$ echo "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++." | python brainfuck.py
```
Read a Brainfuck file
```shell
$ python brainfuck.py helloworld.bf
```
Use in another module
```python
from brainfuck import interpret
interpret("++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.")
```
[1]: http://www.muppetlabs.com/~breadbox/bf/