Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while(playAgain == "N")//starts a new game
- {
- outFile.open("result.txt");
- srand(time(NULL));
- int randNum = (rand() % 30);
- testWord = words[randNum];
- cout << testWord << endl;//FOR TESTING PURPOSES
- while(incorrectGuessCount < 8)//loops until the user either wins or loses
- {
- buildBoard();
- isValidInput();
- }
- outFile.close();
- cout << "\nWould you like to play again? (Y/N)"; cin >> playAgain;
- playAgainChar = playAgain.at(0);
- playAgain = toupper(playAgainChar);
- cout << playAgain << endl;
- if (playAgain == "Y")
- {
- playAgain = "N";
- incorrectGuessCount = 0;
- continue;
- }
- else
- {
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement