This is easy for you. I am busy with a test using c++. I have 2 values:
0 and 1
I can find random number between. Now i want to alternate between them. If i get "1" in step one then in step two I want to get "0" and in step three "1" again where it alternate
step1 = 1
step2 = 0
step3 = 1
step4 = 0
I tried increment and decrements
int value;
if(value == 0)
{
value = value + 1;
}
else if(value == 1)
{
value = value -1;
}
This code does not work. If it sees a 0 it will become 1 but the next step the value will be 1 again.