# BFFuck **Repository Path**: none1-2357/BFFuck ## Basic Information - **Project Name**: BFFuck - **Description**: Makes brainfucking easier! - **Primary Language**: Unknown - **License**: CC0-1.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-08-13 - **Last Updated**: 2025-10-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README [![Downloads](https://static.pepy.tech/badge/bffuck)](https://pepy.tech/project/bffuck) [![Downloads](https://static.pepy.tech/badge/bffuck/month)](https://pepy.tech/project/bffuck) [![Downloads](https://static.pepy.tech/badge/bffuck/week)](https://pepy.tech/project/bffuck) # BFFuck Makes brainfucking easier The tools is an esoteric language that compiles to brainfuck, using algorithms in [brainfuck algorithms](https://esolangs.org/wiki/Brainfuck_algorithms). ### Usage: Run this in Python: ```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: ```text = or = ``` Addition: ```text add(x,) or add(x,) ``` Subtraction: ``` sub(x,) or sub(x,) ``` Multiplication: ``` mul(x,) or mul(x,) ``` Modulo: ``` mod(x,) or mod(x,) ``` While loop: ```text while() CODE endwhile ``` I/O: ```text =in # Reads as decimal integer =inc # Reads as ASCII character out() # Outputs as decimal integer outc() # Outputs as ASCII character ``` String output shortcut: ```text print(STRING) # Without quotes # For instance print(Hello World!) ``` If statement: ```text if() CODE endif if() CODE1 else CODE2 endif ``` Comparison: ```text lt(x,) # 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,) eq(x,) # 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,) ``` Macros: ```text macro $ # Macro with no arguments CODE endmacro macro $(,,...) # Macro with arguments CODE endmacro $ # Using a macro with no arguments $(,,...) # Using a macro with arguments ``` Memory: ```text ptr(a,b) # Store address of a to variable b ref(a,b) # Store value of address b to variable a set(a,b) # Set value of address b to a (variable or integer literal) ``` Libraries ```text ?libraryname ``` Includes the library `library name` (with file extension). It first searches the library in current directory, and then in the `stdlib` directory in the package. There are standard libraries for BFFuck, they are: * `env.bff` gets size of a "byte" specified by the compiler * `alloc.bff` allocates memory * `array.bff` manages memory using arrays * `rng.bff` a not very decent random number generator An example of the `rng.bff` library is here: ```text ?rng.bff x=0 while(1) $rnd(x) outc(x) endwhile ``` Prints random bytes. ### 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! If you're using 32 bit, remember to use an extremely optimizing interpreter like bffsree! 2. It has some bugs. The repository contains some examples, including a Hello World program, a cat program and an A+B program.