I am having a problem with my code. It works fine the first time prompts user etc...however when you lose (no way to win yet not that far in class) it shows you lost and tells you the word. Then prompts user if they want to play again. Its at this point that it wont start the game over. Please HELP. Here is my code:
int main ()
{
//declaration
char guess = '\0';
int wrongGuesses = 0;
bool foundLetter = false;
string guessWord = " ";
int incorrectEntry = 0;
string reply;
int playStatus = PLAY;
getWords("hangman.dat"); //retrieves the words from the list
//input
while(playStatus != STOP)
{
cout << "\nWould you like to play hangman?\tY or N:\n";
cin >> reply;
playStatus = promptYN(stringCaseChanger(reply, true));
if(foundLetter)
{
cout << guess << " is in the word!" << endl;
foundLetter = false;
}
else
{
wrongGuesses++;
cout << guess << " is not in the word." << endl;
if(wrongGuesses == 6)
cout << "Sorry you lose - the word was: " << guessWord << endl;
}