Skip to main content

Just a nice little brainfuck interpreter in Python.

Project description

Just a nice little brainfuck interpreter in Python.

Nope! This is brainfuck-fuck. You know there’s C, then C+, then C++? Well, there’s brainfuck, and now there’s brainfuck-fuck. Brainfuck-fuck is supposedly backwards compatible. So therefore this:

+++++++ [ > ++++++++++ < - ] > ++ . [-]<[-] ++++++++++ [ > ++++++++++ < - ] > +++++ .

does exactly the same thing as this:

=H.=i.

besides the fact that the first one uses two cells while the second uses one.

A full list of additions:

  • The = command. This sets the current cell’s value to the ASCII value of the character after the =. Therefore =H sets the cell to 72 (the ASCII value of H).

  • An if/else statement! The syntax is ? (code) : (code) !. When a ? is reached, it checks the current cell. If the current cell is 0, it skips to the corresponding :. Otherwise, it continues on until the :, then skips to the !. Thus + ? =Y : =N ! . prints out “Y” while ? =Y : =N ! . prints out “N”.

  • Functions! To define a function, use (@ symbol)(single ASCII character)(code)(pipe, |), e.g. @F+++++| (which simply adds 5). To call a function, use a caret (^) and then the ASCII character used to name the function, e.g. ^F (which calls the previously defined function F, thereby adding 5).

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

brainfuck-fuck-2018.1.14.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

brainfuck_fuck-2018.1.14-py2.py3-none-any.whl (6.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file brainfuck-fuck-2018.1.14.tar.gz.

File metadata

File hashes

Hashes for brainfuck-fuck-2018.1.14.tar.gz
Algorithm Hash digest
SHA256 5a517be61606f28f508597e43571b600811792c16ba93bbda0ef836625a2565d
MD5 18c944994e527664126597dbfcb79f00
BLAKE2b-256 dc0bcdb00de5c8b703d547ec5d77fe833babd29d8c22f024ddc812dbfc62a750

See more details on using hashes here.

File details

Details for the file brainfuck_fuck-2018.1.14-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for brainfuck_fuck-2018.1.14-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 42430583820620f6d920cc27a2c0997a7052fa5ca85005f11bb03b42090b62a2
MD5 80ba88ea1add62f4eb832da99cd0e5a6
BLAKE2b-256 b5a47254347b6d28dd22c42e342e6fe10767fc4964f2cfb0bd00b3570cb5c78a

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