@ -24,6 +24,12 @@ void playHangman(char *wordToGuess) {
continue;
}
// Check if the guess is a single letter
if (strlen(&guess) != 1) {
printf("Please enter only one letter.\n");
// Check if the letter has already been guessed by the player
if (strchr(guessedLetters, guess) != NULL) {
printf("You already guessed that letter. Try another letter.\n");