This is a BrianF interpreter coded in scratch BrainF is a very simple programming language. Imagine an endless tape where each cell on the tape can have a value from 0-255 all cells are initialized to 0 There is a pointer that can move along the tape and can edit values on it. to program in BrainF you have 8 commands + : Increase cell at pointer location by one ( wraps back to zero if increased over 255) - : Decrease cell at pointer location by one (wraps back to 255 if decreased under 0) > : moves pointer one cell to the left < : moves pointer one cell to the right [ : if current cell is not zero enter loop, else skip to end of loop ] : if current cell is not zero, repeat loop, else exit loop , : read character from user this command reads only one inputted character and stores it's ASCII value at the current pointer location. If the user enters more than one character, the program adds the remaining characters to a queue to pull from when asking for input later, If the queue is empty, the program will ask for more input. . : outputs ASCII character of current cell value to the console. while this programming language only has 8 commands. It is very hard to program anything substantial in it. Good luck! :-)
Thanks to the scratch wiki page on Case sensing for helping with user input, BrainF was invented by Urban Müller in 1993 as a challenge to make the smallest possible compiler for a programming language. I have tried testing it with various BF programs. Let me know if you find any bugs. click see inside for tested Sample programs. might add some more sample programs later Currently known issues: - Scratch's text font isn't monospaced meaning that some programs won't be formatted the way they should look in a terminal (this would have to be fixed with either adding spaced to manually monospace everything or make a whole terminal in scratch) - the list doesn't scroll automatically so if the output reaches the end of the window, you will need to manually scroll down to it let me know if you find any other bugs, or if you have ideas on how to improve the project :-)