我创建了一个循环,由于某种原因它不会执行。它不是一个无限循环
while ((aH <= 0) || (bH <= 0))
{
// ROUND LOOP START
System.out.println("============");
System.out.println(" Round " + round);
System.out.println("============");
// A TURN START
while (endTurn == 1)
{
System.out.println("==========================");
System.out.println(" Commander " + aN + ", GO!");
System.out.println("==========================");
endTurn++;
// A TURN END
}
endTurn--;
// B TURN START
while (endTurn == 1)
{
System.out.println("==========================");
System.out.println(" Commander " + bN + ", GO!");
System.out.println("==========================");
endTurn++;
// B TURN END
}
endTurn--;
bH -= 10;
round++;
// ROUND LOOP END
}
System.out.println("The loop was skipped for some reason");
当我在循环上执行测试时,就会发生这种情况。
The loop was skipped for some reason
目前循环没有任何意义,它将具有功能,但我目前关注的是它没有执行。有没有人看到这个问题?
答案 0 :(得分:0)