Iraq While Loop

Even green-bean programmers know the difficulty that a “while loop” presents. But if you don’t know how many times the block of code should be executed a while loop can be a great choice.

The while loop repeats a statement until the test at the top proves false.

while (Terrorist)
{
makeWar;
}

There are two problems in this.

  • No definition of the variable Terrorist, and
  • no way to change the variable’s value.

    While loops are easy to enter, and if they aren’t thoughtfully designed they lead to infinite loops.
    only an exit() will break.