diff --git a/src/main/c/Hangman/playHangman.c b/src/main/c/Hangman/playHangman.c index 0fe32f7..178c872 100644 --- a/src/main/c/Hangman/playHangman.c +++ b/src/main/c/Hangman/playHangman.c @@ -46,6 +46,14 @@ void playHangman(char *wordToGuess) { mistakes++; } + // Check if the player guessed all the letters + if (strcmp(currentGuess,wordToGuess) == 0){ + currentState(currentGuess, mistakes); + printf("Bravo! You guessed the word: %s \n", wordToGuess); + break; + } + + } } \ No newline at end of file