I dont know why i did this and i would rather not know
Im sure most of you know about the 8 base characters used in Brainfuck but either way, I will go over them
-
Simple, Brainfuck has 30,000 memory cells and 80,000 in my case and the > and < are used to make the memory pointer move either left or right
-
Self explanatory, Adds or subtracts the number present in the current cell the pointer is at (Each cell is a byte (0-255))
-
"," Is used to read user input and put its ASCII representation in the current cell, As you might have guessed the "." Is the exact opposite.
-
Those ones are a bit complicated so i might not explain them well Either way i will take a shot at it, The "[" works by checking if the current cell is 0 or not, If it is, Then jump to the corresponding "]" And the closing bracket does the exact opposite, Creating conditional loops
-
Jumps to a certain memory address,
{5315}Jumps to address 5315 - Usage same as before but instead sets the current value directly
- More obscure and i doubt you will be using it but it basically makes the instruction pointer jump, So you have to keep track of the count of instructions if you want to practically use this
-
Now you can make a window and write to each pixel manually,
How exciting- Set address 250 to 1
- Set 251 to the X size in pixels and 252 for the Y
- 253+ X*Y is now video memory and 0-15 represents each color (More on that later)
- You manually write to each pixel I.e
253-65,278at max (About 65,025) - Just set address 79998 to 1 (Then maybe reset it so you dont nuke your memory on accident (More on that later))
- And now you have a window, The pixel data updates in real time
-
Because running commands can be quite dangerous, You will need to place the second argument as AC (Allow commands)
- Address
192-248are the command buffer, Only ASCII characters in decimal form are allowed - Set address 249 to 1, It will automatically be reset by the interpreter after
- The output of the command will be from 65279 to 65343 (64 bytes)
-
- Some functions will require extra confirmation either because they are very heavy in resources, Or to act as an extra "Are you sure?"
- To delay program execution all you need to do is put in address 79997 the number of milliseconds you want to wait for (Will be automatically reset after by the interpreter)
- I have added a ... Quite special function that will reset or clear the entire memory tape, You run it by setting Ad. 79998 to 1 along with 79996 the entire tape will be reset except for 79999 which is SUPPOSED to be accessed by the interpreter only but im sure you can figure out what its for, And maybe even have some fun with it
- Now sometimes if the instructions end, But some other things are running or another window is open or anything really, I have implemented a "Shutdown sequence" so it ensures the program ends leaving nothing behind
-
Color Code 0-15 Black 0 Dark Gray 1 Gray 2 Light Gray 3 White 4 Red 5 Green 6 Blue 7 Yellow 8 Orange 9 Purple 10 Maroon 11 Lime 12 Sky Blue 13 Brown 14 Pink 15 Note: I forgot to add this while writing but there is a debug mode basically by making the 3rd argument when running the program be Debug (1st argument is path of the bf++ script, 2nd is AC (Allow commands) and 3rd is debug) There is also the 4th argument which can be "big" (Makes the interpreter use an int array tape instead of a byte one)