#Include Iostream
#Include Iostream
#Include Iostream
#include <string>
#include <cctype>
#include <set>
using namespace std;
void add() {
int close = 0;
system("color F");
cout << " \n WELCOME TO PROGRAMMING\n";
cout << " FIND THE HIDDEN WORDS IN THE WORD HUNT BOARD.\n\n";
if (guessedWords.count(userGuess) > 0) {
cout << " THE WORD IS ALREADY ANSWERED. TRY A DIFFERENT WORD.\n";
continue;
}
if (!correctGuess) {
cout << "\tSORRY, THE WORD IS INCORRECT. TRY A DIFFERENT WORD.\n";
}
if (i == 4) {
cout << "\n Congratulations, you've guessed " << score << " out of " <<
totalWords << " words correctly. Well done.\n";
char playAgain;
cout << "\n Do you want to play again? [Y/N]: ";
cin >> playAgain;
while (close != 1) {
if (playAgain == 'y' || playAgain == 'Y') {
close = 1;
system("cls");
add();
} else if (playAgain == 'n' || playAgain == 'N') {
close = 1;
} else {
cout << "Invalid entry!";
}
}
}
}
}
int main() {
add();
return 0;
}