Skip to main content

Makes Brainfucking Easier!

Project description

Downloads Downloads Downloads

BFFuck

Makes brainfucking easier

The tools is an esoteric language that compiles to brainfuck, using algorithms in brainfuck algorithms.

Usage:

Run this in Python:

from bffuck import BFFuck
bff=BFFuck()
bf=bff.compile('Your code')

Note that if a BFFuck object is created and used, its status will change and therefore cannot compile another program.

Syntax

BFFuck currently supports the following syntax:

Comment:

# Comment

Variable definition:

<variable 1>=<variable 2>
or
<variable>=<number>

Addition:

add(x,<number>)
or
add(x,<variable>)

Subtraction:

sub(x,<number>)
or
sub(x,<variable>)

Multiplication:

mul(x,<number>)
or
mul(x,<variable>)

Modulo:

mod(x,<number>)
or
mod(x,<variable>)

While loop:

while(<variable or number>)
CODE
endwhile

I/O:

<variable>=in # Reads <variable> as decimal integer
<variable>=inc # Reads <variable> as ASCII character
out(<variable or number>) # Outputs <variable> as decimal integer
outc(<variable or number>) # Outputs <variable> as ASCII character

String output shortcut:

print(STRING) # Without quotes
# For instance
print(Hello World!)

If statement:

if(<variable or number>)
CODE
endif

if(<variable or number>)
CODE1
else
CODE2
endif

Comparison:

lt(x,<number>) # Compares x and the variable or number, if x is less than the variable or number, set x to 1, otherwise 0
or
lt(x,<variable>)

eq(x,<number>) # Compares x and the variable or number, if x is equal to the variable or number, set x to 1, otherwise 0
or
eq(x,<variable>)

Platform

BFFuck is in pure Python and therefore it supports any platform.

Constraints

Programs compiled from BFFuck needs you to have 8 bit cells that wrap.

Disadvantages

BFFuck currently has these disadvantages:

  1. It's numbers are 8 bit numbers. You can choose 8-bit, 16-bit or 32-bit numbers using the byte keyword argument. But you need to run it on a 8-bit interpreter. REMEMBER: Using numbers with more bits is slower and increases the size of program largely!
  2. It has some bugs.

The repository contains some examples, including a Hello World program, a cat program and an A+B program.

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

BFFuck-2.0.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

BFFuck-2.0.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file BFFuck-2.0.0.tar.gz.

File metadata

  • Download URL: BFFuck-2.0.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.0

File hashes

Hashes for BFFuck-2.0.0.tar.gz
Algorithm Hash digest
SHA256 eee05a45e50df51bbadc764aac41834812f97e5ea47bdb49635d63382061f3bb
MD5 eeae2e9cdd229293be3a17d4eed03381
BLAKE2b-256 0fc682e963874d64adba1e92e3a532d29fe7512793fe133e5692fad881cd0116

See more details on using hashes here.

File details

Details for the file BFFuck-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: BFFuck-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.0

File hashes

Hashes for BFFuck-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 07ab4d1be02d36f33576f0d69a2e9663d38eb7ae224461ef3897c284abfbb2a1
MD5 9c924e5e825239b8221bf8818f35d05a
BLAKE2b-256 2dbfb88a4aa71a89bd77c0a19f615f30c80eb745281acc8e6fcdf59c4d24d70d

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