diff --git a/src/main/c/Hangman/playHangman.c b/src/main/c/Hangman/playHangman.c index 93d9998..68e34c0 100644 --- a/src/main/c/Hangman/playHangman.c +++ b/src/main/c/Hangman/playHangman.c @@ -11,6 +11,7 @@ char toLower(char ch) { void playHangman(char *wordToGuess) { int mistakes = 0; + int score = 10; char guessedLetters[30] = ""; //Guessed letters char currentGuess[50]; //Current state of the guessed word @@ -62,12 +63,14 @@ void playHangman(char *wordToGuess) { // Update mistakes (if the guess is wrong) if (!found) { mistakes++; + score--; } // Win: 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); + printf("your score is %d/10\n", score); printf("\n" " __ __ __ __ _ \n" " \\ \\ / /__ _ _ \\ \\ / /__ _ _ | |\n"