TL;DR: same as https://scratch.mit.edu/projects/558336302/ with some updates Turbo mode recommended *Scroll to the bottom for changelogs ############################################ brain****!! ############################################ What is this? How do I use it? brain****, apart from having a name that forces you to swear when saying it out loud, is a programming language designed to have the smallest compiler possible (and maybe also to cause lots of headaches as suggested by its name). This language stores data on an infinitely long tape containing cells (this isn't true for some interpreters, but this interpreter attempts to emulate that). Each cell can ONLY store integers from 0 to 255. (meaning if you add more than 255, the cell will overflow back to 0, and if you subtract less than 0, it will underflow back to 255) You can move a "pointer" to the left or right to access different cells and then read from or write to that cell. Ok, now that we've got all those concepts out of the way, we can get to the commands. *Note: Whenever I say "current cell", I'm referring to the cell that the pointer is pointing at This language has only 8 commands, and they are: - "+": Add 1 to the current cell - "-": Subtract 1 from the current cell - ">": Move the pointer 1 cell to the right - "<": Move the pointer 1 cell to the left - ".": Output the ASCII character that corresponds to the value in the current cell - ",": Take input as an ASCII character and store its ASCII code to the current cell - "[" and "]": Any command inside these brackets will be looped until the cell at the pointer is 0 Press the green flag to reset everything and input code for programs Arrow keys to scroll the text display (idk what to call it) ############################################ Notes - This interpreter still has some bugs that I haven't been able to fix, so some programs won't work. - Because this interpreter is made on Scratch and made by me, it's not very fast or optimized, so keep that in mind - I suggest finding another interpreter online if you want to try out long programs for the reasons above ############################################ What's next? If this project gets enough attention, I'll come back and: - Add cloud variables so you guys can share your programs (though this is probably a bad idea) - Fix the bugs - Make a better UI ############################################ Links: If you are still confused, I suggest checking out: https://esolangs.org/wiki/Brainf*ck (replace the "*" with an "u" if you do want to actually use the link because I can't write swears in here) You should also check out: https://copy.sh/brainf*ck/text.html (again, replace the "*" with an "u") Most commands generated from there work in this interpreter I also recommend checking out this https://www.youtube.com/watch?v=qK0vmuQib8Y ############################################ Changelogs: 2021-11-25: - Added menu with some functionalities: + Show/hide tape + Option to pre-supply input + Added a debugger: Use "#" as a breakpoint when the debugger is turned on
All interpreter code by me Text engine modified from @-Rex-Test- 's text engine (You can use the text engine in this project if you want but remember to credit me and @-Rex-Test-)