All Projects → elikaski → BF-it

elikaski / BF-it

Licence: MIT license
A C-like language to Brainfuck compiler, written in Python

Programming Languages

python
139335 projects - #7 most used programming language
C++
36643 projects - #6 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to BF-it

asmbf
The only true brainfuck-targetting assembler.
Stars: ✭ 81 (-19.8%)
Mutual labels:  brainfuck, brainfuck-compiler, brainfuck-interpreter
llvm-brainfuck
Brainfuck compiler based on LLVM API
Stars: ✭ 27 (-73.27%)
Mutual labels:  brainfuck, brainfuck-compiler, brainfuck-interpreter
BrainF.Net
A .NET brainfuck code parsing and execution library
Stars: ✭ 23 (-77.23%)
Mutual labels:  brainfuck, brainfuck-compiler
Brainfuck
A flexible Brainfuck / Brainloller / Braincopter interpreter in Swift 3.1.
Stars: ✭ 13 (-87.13%)
Mutual labels:  brainfuck, brainfuck-interpreter
ojisan f-ck
おじさん風文章を解釈して動く Brainfuck interpreter
Stars: ✭ 20 (-80.2%)
Mutual labels:  brainfuck, brainfuck-interpreter
esoo
Like the Programming Languages Zoo but with esoteric languages.
Stars: ✭ 18 (-82.18%)
Mutual labels:  brainfuck, brainfuck-interpreter
bfloader
🧠 Brainfuck IDE and interpreter in 512 bytes. (boot sector)
Stars: ✭ 41 (-59.41%)
Mutual labels:  brainfuck, brainfuck-interpreter
brainfuck
Brainfuck interpreter companion to the brain programming language
Stars: ✭ 32 (-68.32%)
Mutual labels:  brainfuck, brainfuck-interpreter
FasterBrainfuckProgramming
This project is to make brainfuck language programming easier, faster and more powerful .. everything is made out of functions making it very easy to port to other languages
Stars: ✭ 19 (-81.19%)
Mutual labels:  brainfuck, brainfuck-compiler
vbf
A brainfuck interpreter/compiler written in V.
Stars: ✭ 17 (-83.17%)
Mutual labels:  brainfuck, brainfuck-interpreter
BfBf
A Brainfuck interpreter written by Brainfuck.
Stars: ✭ 37 (-63.37%)
Mutual labels:  brainfuck, brainfuck-interpreter
BrainfuckIDE
A Brainfuck IDE/debugger designed to be intuitive, featureful and visually appealing
Stars: ✭ 77 (-23.76%)
Mutual labels:  brainfuck, brainfuck-interpreter
bfboot
A full brainfuck to bootable OS image compiler.
Stars: ✭ 35 (-65.35%)
Mutual labels:  brainfuck, brainfuck-compiler
brainfuck
A simple brainfuck interpreter in Rust.
Stars: ✭ 18 (-82.18%)
Mutual labels:  brainfuck
bf256
Brainfuck compiler under 256 bytes in size.
Stars: ✭ 21 (-79.21%)
Mutual labels:  brainfuck
brainfuck2wasm
A brainfuck-to-WebAssembly compiler
Stars: ✭ 36 (-64.36%)
Mutual labels:  brainfuck
harbor
A language that ports⚓: examining the limits of compilation⚙️.
Stars: ✭ 81 (-19.8%)
Mutual labels:  brainfuck
brainhug
A simple brainfuck translator crate in Rust
Stars: ✭ 14 (-86.14%)
Mutual labels:  brainfuck
bfpile
Optimizing Brainfuck compiler, transpiler and interpreter
Stars: ✭ 19 (-81.19%)
Mutual labels:  brainfuck
Klipse
Klipse is a JavaScript plugin for embedding interactive code snippets in tech blogs.
Stars: ✭ 2,841 (+2712.87%)
Mutual labels:  brainfuck

BF-it logo

BF-it

A compiler from a C-like language to Brainfuck

Always heard that Brainfuck is Turing complete but still had doubts about its computational power? Those days are over

What is this?

BF-it is a Compiler of a C-like language to Brainfuck, written in Python

You give it C-like code, and it gives you Brainfuck code with the same functionality :)

Why did you create it?

There are several reasons why I chose to create this

  1. I always heard that Brainfuck is Turing complete, and therefore as strong as any other language
    • I wanted to put that to the test, and find a concrete proof that it is true
  2. I find it beautiful how a seemingly bunch of nonsense characters can have a logical meaning / functionality
    • I wanted to take it to the extreme
  3. I wanted to practice my developing skills
  4. It seemed to be like a real challenge (and it was!)
  5. But mostly, and most importantly, I did it for teh lulz

What can I use it for?

Create a Brainfuck code of your choice, send it to your friends, and tell them to run it (on some online interpreter, for example)

When they receive a bunch of nonsense which does something meaningful, they will (maybe) be amazed

How do I use it?

  1. Write a C-like code (example programs included) into a file
  2. Open your favorite command line interface
  3. Run BF-it.py <path_to_code_file>
    • This will compile your file and create a .bf file with Brainfuck code
    • (optional parameters: -o for output file, and -r for running the compiled file)
  4. Run Interpreter.py <path_to_bf_file>, this will execute the Brainfuck code

Example:

$ cat helloworld.code
int main()
{
    print("Hello World!\n");
}

$ ./BF-it.py helloworld.code
Compiling file 'helloworld.code'...
Compiled successfully to 'helloworld.bf'
$ cat helloworld.bf 
>[-]>[-]<>++++++++[-<+++++++++>]<.>++++[-<+++++++>]
<+.+++++++..+++.>++++++[-<------------->]<-.>+++++[
-<+++++++++++>]<.>++++[-<++++++>]<.+++.------.-----
---.>++++++[-<----------->]<-.>+++[-<------->]<--.<

$ ./Interpreter.py helloworld.bf
Hello World!

For a more interesting example, check out Tic-Tac-Toe!

Tic-Tac-Toe

  1. Take a look at tic_tac_toe.code in the 'examples/games' directory
  2. Run ./BF-it.py examples/games/tic_tac_toe.code -r
  3. Play around
  4. If you're brave, take a look at the generated Brainfuck code
  5. If you're very brave, try to understand it (I can't)

How do I write code?

Please refer to the 'examples' directory. It contains examples and explanations for syntax, operations, flow, and more

I would like to add a feature / fix a bug

If you would like to add a feature yourself, perform a pull request and add your changes. I will review them

If you found a bug, or have an idea for a feature, open an issue

References I used:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].