< Previous | Contents | Next >

Ending the Game

At this point, the player has guessed the word or has made one too many incorrect guesses. Either way, the game is over.

//shut down

if (wrong == MAX_WRONG)

{


}

else

{


}

cout << "\nYou’ve been hanged!";


cout << "\nYou guessed it!";


cout << "\nThe word was " << THE_WORD << endl;


return 0;

}

I congratulate the player or break the bad news that he or she has been hanged. Then I reveal the secret word.