Let's assume for a moment you're programming a game, how do you go about ending it in the event that the win condition is achieved? Right now, my rough idea is this. (this is all going to be pseudocode) I'm just putting this here to make sure my logic is sound before I try coding this in a few hours after I complete all my other game stuff
boolean isPlayerTurn=false;
boolean isCPUTurn= false;
boolean isGame=true;
while (isGame){
isCPUTurn = true;
while (isCPUTurn){
//do cpu turn stuff
//assuming it make it through everything
//Do I check for win conditions in each players loop, if so how do I break the loop since it's a nested while?
isCPUTurn = false;
}
isPlayerTurn= true;
while(isPlayerTurn){
//Do player turn stuff
//end turn if all goes smoothly
isPlayerTurn=false;
}
That's my current turn system in a nutshell, but lets assume that it's in the CPU turn and they score a winning hit, if I do an if that generates a break, won't it just break from the CPUTurn loop and not from isGame? Is my logic totally off here? Help?

