I advise anyone getting started with BrainFuck should write the C implementation of the code you have in mind. To learn more https://en.wikipedia.org/wiki/Brainfuck
The C implementation of your question will look like this
#include <stdlib.h>
#include <stdio.h>
void main(void)
{
char array[20];
array[0] = 8;
array[1] = 51;
array[2] = 50;
while (array[0] != 0)
{
array[1] -= 6;
array[2] -= 6;
array[0]--;
}
array[1]++;
while (array[1] != 0)
{
while (array[2] != 0)
{
array[3]++;
array[4]++;
array[2]--;
}
while (array[3] != 0)
{
array[2]++;
array[3]--;
}
array[1]--;
}
array[0] = 8;
while (array[0] != 0)
{
array[4] += 6;
array[0]--;
}
putchar(array[4]);
}
then you can move over to the BrainFuck code which is this
++++ ++++ Cell c0 = 8
>, Reads input and stores in c1
>, Reads input and stores in c2
<< Moves to c0
[
>--- --- Minus 6 from c1
>--- --- Minus 6 from c2
<<- Minus 1 from c0
]
> Moves to c1
[
> Moves to c2
[
>+ Increment c3 by 1
>+ Increment c4 by 1
<<- decrement c2 by 1
]
> move to c3
[
<+ increment c2
>- decrement c3
]
<<- decrement c1 by 1
]
<++++ ++++ cell c0 = 8
[
>>>>+++ +++ increment c5 by 6
<<<<- decrement c0 by 1
]
>>>>. print c4
my suggestion any line you write in BrainFuck always comment what it's doing