Basics Of BrainFuck.
Any self-assertive character other than the 8 recorded above ought to be overlooked by the compiler or translator. Characters other than the 8 administrators ought to be considered remarks.
All memory obstructs on the "cluster" are set to zero toward the start of the program. What's more, the memory pointer begins on the left-most memory square.
Loops might be settled the same number of times as you need. Yet, all [ must have a corresponding ].
Also, Read - More About Brain Fuck.
let's start with some examples of brainfuck programming languages.
- a simple program in brainfuck
[-]
- starts with real program
+++++[-]
- this program is the same as C Programming:
*p=+5;
while(*p!=0){
*p--;
}
in that program, we are incrementing the current memory pointers value to 5,
then entering a loop that decreases that values and are located at the memory pointer till it is zero, and then exist the loop. so, let's see below
>>>>>++
this will move the memory pointer to the fourth memory block and increment the adored values there by 2.
like this,
-------------------------------
[0] [0] [0] [2] [0] [0]..
Comments
Post a Comment