Makes Brainfucking Easier!
Project description
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>)
Macros:
macro $<name> # Macro with no arguments
CODE
endmacro
macro $<name>(<arg1>,<arg2>,...) # Macro with arguments
CODE
endmacro
$<name> # Using a macro with no arguments
$<name>(<arg1>,<arg2>,...) # Using a macro with arguments
Memory:
ptr(a,b) # Store address of a to variable b
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:
- It's numbers are 8 bit numbers. You can choose 8-bit, 16-bit or 32-bit numbers using the
bytekeyword 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! - It has some bugs.
The repository contains some examples, including a Hello World program, a cat program and an A+B program.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file BFFuck-2.1.0.tar.gz.
File metadata
- Download URL: BFFuck-2.1.0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f82f2ddbc5042646bdf02569f40b1b4b870cb9a167705832b4d207fbce6c4059
|
|
| MD5 |
a8ebeb4955c2ebda429fb8c7f5bd11fc
|
|
| BLAKE2b-256 |
2292269c87ef080a36f00c977b98486aa21cf0f81ad8c0d406199670ef34cbf1
|
File details
Details for the file BFFuck-2.1.0-py3-none-any.whl.
File metadata
- Download URL: BFFuck-2.1.0-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35dd23a6d6c2c58c29e16d999bd557ea1caa7cbb4e871b572f2a290999e1ea31
|
|
| MD5 |
8cbe5a5885a42ef44969423b0a3a2433
|
|
| BLAKE2b-256 |
f3cff580bbc46518aff0ef0f8be48b20ad6365e39da8dedab0ab9ab086e9b994
|