Skip to main content

Just another rethink of the BrainFuck language

Project description

NeoBrainFuckInterpreter

NeoBrainFuckInterpreter is a Python interpreter for the Brainfuck programming language with additional commands for extended functionality.

Overview

This interpreter supports the basic Brainfuck commands (+, -, <, >, [, ], ., ,) and introduces three additional commands:

  • $: Switches IO mode to ASCII.
  • %: Switches IO mode to integers.
  • ^: Jumps to memory cell with address which equals the value of current memory cell.
  • &: Jumps to the instruction with address which equals the value of current memory cell.
  • 0: NOP (No operation)

The interpreter manages memory using a dynamic stack (MemoryStack), allowing for negative indices and dynamic memory expansion.

Usage

Installation

Clone the repository:

git clone https://github.com/kusrabyzarc/NeoBrainF--k.git
cd NeoBrainF--k

Interpreter args

code: [str] BrainFuck code
do_debug: [bool] print debug info (default: False)
vanilla_cell_behaviour: [bool] clamp the values in memory to the range 0-255 (default: False)
vanilla_memory_stack: [bool] use static 30k-sized memory stack instead of dynamic one (default: False)

Examples

You can find examples here.
In progress.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

neobrainfuck-1.1.1a0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

neobrainfuck-1.1.1a0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file neobrainfuck-1.1.1a0.tar.gz.

File metadata

  • Download URL: neobrainfuck-1.1.1a0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.2

File hashes

Hashes for neobrainfuck-1.1.1a0.tar.gz
Algorithm Hash digest
SHA256 b7bc22e37a386fc84f5e1b17d8539602d955193210820c6bea45b210d6e26c22
MD5 59b2365a0972655fd1d8ff71fbfbb69f
BLAKE2b-256 4b6af56e6c7c14ca298274e03429bce26d563bd79395998f992fcf591c2db3b5

See more details on using hashes here.

File details

Details for the file neobrainfuck-1.1.1a0-py3-none-any.whl.

File metadata

File hashes

Hashes for neobrainfuck-1.1.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 fae37edebc91c34be53ac7006b27e1185ca57b0a392b8e1b95e1cbb7329dd462
MD5 08139238a1f52aa9a2c553f2fff02ef4
BLAKE2b-256 29bc1a553d81a0c5a395ea238adc035a12a21a5a8fb07ac276e4628f6ce11e39

See more details on using hashes here.

Supported by

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