Skip to content

Brainfuck processor written in C++. Features support for randomness, JIT compilation and AOT compilation

License

Notifications You must be signed in to change notification settings

DrParanoya/Brainfuck.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Brainfuck

Brainfuck.

Brainfuck processor written in C++. Features support for randomness, JIT compilation and AOT compilation.

This implementation has 65 536 memory cells (uint16_t limit).

Future plans: (Roadmap)
Version 1.0.1

When running this, a terminal will open.
Enter the filepath to your brainfuck file (file extension doesn't matter).

A regex search will be performed to read the flags, anything behind the flags will be appended to the file path!

The following flags are allowed:

-i will just interpret the code (default, will be used if no mode is specified).
-e will compile the code first and then run the generated bytecode.
-c will compile the code into a .bfbc (stands for BrainFuckByteCode) file.
-r will try to run a .bfbc from the filepath you entered.
-a will turn your brainfuck code into C++ code and store it in a .cpp file.
-l will perform a check if all brainfuck loops open and close correctly. Gets executed by default to prevent errors.

-? will enable randomnes (every ? inside your brainfuck code will randomize the value of the current cell).

Important: -? should only be placed after the mode flag!

Examples:

C:\Users\User\Desktop\Brainfile.txt -e -?
This will compile Brainfile.txt into Brainfile.txt.bfbc with support for randomnes and run it.

C:\Users\User\Desktop\HelloBf.bfbc -r
This will execute the BrainFuckByteCode inside the HelloBf.bfbc file without support for randomnes.

C:\brainfuck_code.txt
This will interpret the file brainfuck_code.txt without support for randomnes.

C:\Users\User\Images\Screenshot22.png -? This will interpret the file Screenshot22.png with support for randomnes.

Bugs / Contributing:

If you encounter any bugs feel free to open an issue. Please describe it as accurately as possible.
If possible, add the steps to reproduce it.
To contribute, just open a pull request.

Do not ask questions about how brainfuck works!

This project is licensed under the GNU GENERAL PUBLIC LICENSE Version 3

About

Brainfuck processor written in C++. Features support for randomness, JIT compilation and AOT compilation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages