I dont know how to do this without using a goto.
I’m making a network card reading game that has .. states, waiting for at least 2 players After 2 players have entered it does a while loop, where after game is finshed it will repeat. Within this loop, there are 3 more loops for shuffle, turn card over look at card. If in any of the 3 loops, players quit and there is only 1 or no players left, how can I make it go to the top of the code where the waiting for 2 player loop is
Do{
// waiting for two player???
….......
} while less then 2 players
while(true)
{
shuffle cards
wait for all players to see cards
****** if players quit how can it go to waiting state
do{
turn card over
****** if players quit how can it go to waiting state
wait for all players to see card
Look at the card blown up
} while turn over cards<12)
} // true reloop game
I think you’re looking for labels. If you have nested loops, you can
continuethe outer loop if it has a label:By wrapping your whole code in a while loop, when you need to “quit”, just continue the outer loop to start back from the start.