hangman code wont continue loop

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:

#include <string>
#include <cctype>

using namespace std;

#include "randword.h";
#include "MyFuncts.h";

void drawHangman(int wrongGuesses);

const string BOARD = " -------|\n | |\n |\n |\n |\n |\n -----\n";
const string BOARD2 = " -------|\n | |\n O |\n |\n |\n |\n -----\n ";
const string BOARD3 = " -------|\n | |\n O |\n | |\n |\n |\n -----\n";
const string BOARD4 = " -------|\n | |\n O |\n -| |\n |\n |\n -----\n";
const string BOARD5 = " -------|\n | |\n O |\n -|- |\n |\n |\n -----\n";
const string BOARD6 = " -------|\n | |\n O |\n -|- |\n / |\n |\n -----\n";
const string BOARD7 = " -------|\n | |\n O |\n -|- |\n / \\ |\n |\n -----\n";

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(playStatus == STOP)
{
cout << "\nCome back soon!\n";
break;
}

if(playStatus == ERROR)
{
incorrectEntry++;
while(incorrectEntry != 3)
{
cout << "\nInvalid Entry!\n";
}
if(incorrectEntry == 3)
{
cout << "\nToo many Invalid Entries! Try again later.\n";
break;
}
}
else
cout << "Great Lets Play!" << endl;

guessWord = getNextWord();

for(int i = 0; i < guessWord.length(); i++)
{
guessWord[i] = toupper(guessWord[i]);
string stringCaseChanger(string str);
}

cout <<"\nWord to Guess: " << guessWord << endl;

while(wrongGuesses !=6 && playStatus == PLAY) // 6 guesses while loop 2
{
cout << "Please enter a letter to guess: ";
cin >> guess;
guess = toupper(guess); //capitalizes letter guessed
cout << "You guessed letter " << guess << endl;

for(int i=0; i < guessWord.length(); i++)
if(guessWord[i] == guess)
{
foundLetter = true;
break;
}

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;
}

drawHangman(wrongGuesses);

}

}
system("pause");
return 0;
}
Topic archived. No new replies allowed.