Hi, I am trying to establish a game loop for my game where if the player wins or loses a game of Hangman he has the option of playing again. I am having difficulty creating a loop for this to work. Please help if you can. Thanks.
void askGuess();
bool match(string word, char letter);
const int MAX_WRONG = 2; // max a player can get wrong
int wrong = 0; //incorrect letters
char restart;
string THE_WORD = ""; // randomized word to guess
string soFar = "";
string used = ""; //guessed letters
int main()
{
vector<string> words; //hangman words
words.push_back("HERO");
words.push_back("SUPERMAN");
words.push_back("PENGUIN");
words.push_back("IPOD");
words.push_back("SUNBURN");
words.push_back("FOLDER");
words.push_back("MONKEY");
words.push_back("CALCULATOR");
Okay galik, i basically copied and pasted what you wrote into my code, but i seem to retrieve the same error. This assignment is due in the next hour, hopefully we can make something happen by then :). Thanks man.