- #1
ecastro
- 254
- 8
Here is my code:
For this code, the 'while' loop should stop when 'a' reaches 3, however it does not, even though 'a' starts with a higher value than 3.
The 'other expressions' part are calculations that manipulate 'b', the only time I manipulate 'a' is at the first line of the loop. So, it should still work due to the 'OR' condition imposed by the '||' symbol. What could be wrong?
I tried removing the second condition and it works, but I cannot remove it here because it is essential to my calculations.
Code:
while a ~= 3 || b <= 1;
a = a - 1;
(other expressions);
end;
For this code, the 'while' loop should stop when 'a' reaches 3, however it does not, even though 'a' starts with a higher value than 3.
The 'other expressions' part are calculations that manipulate 'b', the only time I manipulate 'a' is at the first line of the loop. So, it should still work due to the 'OR' condition imposed by the '||' symbol. What could be wrong?
I tried removing the second condition and it works, but I cannot remove it here because it is essential to my calculations.