Brainfuck interpreter and code generator
Project description
A Python package that provides a Brainfuck interpreter and code generator modules. It also provides command line utility.
Interpreting a Brainfuck code file is as easy as:
$ pybf -i code.bf
Or from standard input:
$ echo "+++++++++++." | pybf -i -
To generate Brainfuck code that will reproduce any content you supply:
$ echo "hello world" | pybf -g -
Installation
To install it using pip all you have to do is:
$ pip install pybf
To install it using the provided setup.py file, you’ll need to install distutils first and then issue the following command:
$ python setup.py install
Usage details
The interpreter by default will reserve 30000 1-byte cells but you can change that by supplying the -s with the desired value.
The Brainfuck code generator by default reserves 16 cells, memory size here is a trade-off between optimizing (for size) between big and small input as with more reserved cells the bigger Brainfuck (loop) initialization code will be and less Brainfuck instructions to reproduce 1 byte. The opposite goes for increasing the number of reserved cells as the initialization code will be smaller but there will be more instructions to reproduce 1 byte.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file PyBF-0.2.1.tar.gz.
File metadata
- Download URL: PyBF-0.2.1.tar.gz
- Upload date:
- Size: 26.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8db7cac649a7aa7ee125437572b5e79410172e8ea1c3d8b39d04866667b980c
|
|
| MD5 |
a2f288225407cc19731559a746c76cac
|
|
| BLAKE2b-256 |
207047004f30b0e8576c663e751ff47348a025d108b659630139e171ba002aa3
|