Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. while(playAgain == "N")//starts a new game
  2. {
  3. outFile.open("result.txt");
  4. srand(time(NULL));
  5. int randNum = (rand() % 30);
  6.  
  7. testWord = words[randNum];
  8. cout << testWord << endl;//FOR TESTING PURPOSES
  9.  
  10. while(incorrectGuessCount < 8)//loops until the user either wins or loses
  11. {
  12. buildBoard();
  13. isValidInput();
  14.  
  15. }
  16.  
  17. outFile.close();
  18.  
  19. cout << "\nWould you like to play again? (Y/N)"; cin >> playAgain;
  20. playAgainChar = playAgain.at(0);
  21. playAgain = toupper(playAgainChar);
  22. cout << playAgain << endl;
  23. if (playAgain == "Y")
  24. {
  25. playAgain = "N";
  26. incorrectGuessCount = 0;
  27. continue;
  28. }
  29. else
  30. {
  31. break;
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement