Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyBF-0.1.0.tar.gz (15.5 kB view details)

Uploaded Source

File details

Details for the file PyBF-0.1.0.tar.gz.

File metadata

  • Download URL: PyBF-0.1.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PyBF-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b674cafc7389ea55bcfd1d52a8c816f8492a6365038f5d967dbfa8b3317f9b04
MD5 86a36aa05635417d9830fcde753ece98
BLAKE2b-256 f9780448fa1502b7aa43456b246293a188535e376873be4d402e3428d570e7de

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page