Hi, I am writing a simulator for a game. I have been stuck at a couple if statements executing regardless of false conditions every time the flow of execution reaches it. Here's the format with psuedo-variables:
Then, I have another one with almost the exact variables. I am writing this in BlueJ and used the debugger to make sure that indeed, timeA - timeB < 3 + count * 3 when x += y and count++ executes. Frustrated, I even put
right before x += y and sure enough, I would get things printed like 5.43 >= 20 so I know for sure it's not an issue of not knowing my variables.
Is it possible that BlueJ or it's terminal window/debugger is simply bugged or is there something special about having if statements right next to each other? Or is it something very simple that I overlooked.
Code:
if(timeA - timeB >= 3 + count * 3)
{
x += y;
count++;
}
Code:
System.out.println((timeA - timeB) + " >=" + (3 + count * 3));
Is it possible that BlueJ or it's terminal window/debugger is simply bugged or is there something special about having if statements right next to each other? Or is it something very simple that I overlooked.
Comment