Browse Source

Game Over

remotes/origin/Saba
Saba Fazlali 11 months ago
parent
commit
fbe98a9f62
  1. BIN
      cmake-build-debug/.ninja_deps
  2. 6
      cmake-build-debug/.ninja_log
  3. BIN
      cmake-build-debug/CMakeFiles/pmuw_projekt_notebinder.dir/src/main/c/Hangman/word_selector.c.o
  4. 9
      src/main/c/Hangman/playHangman.c
  5. 1
      src/main/c/Hangman/playHangman.h

BIN
cmake-build-debug/.ninja_deps

6
cmake-build-debug/.ninja_log

@ -7,3 +7,9 @@
0 106 1706551301992114407 CMakeFiles/pmuw_projekt_notebinder.dir/src/main/c/Hangman/drawHangman.c.o de5f7edc6c2379d7
1 44 1706122039878920765 CMakeFiles/pmuw_projekt_notebinder.dir/src/main/c/Template/game100.c.o 69a5bcd8c57a43b3
106 195 1706551302079685763 pmuw_projekt_notebinder fbb48fd3bf0b96c1
0 213 1706706276607336012 CMakeFiles/pmuw_projekt_notebinder.dir/src/main/c/Hangman/word_selector.c.o fab41de4b8cc0421
1 214 1706706276607356095 CMakeFiles/pmuw_projekt_notebinder.dir/src/main/c/Hangman/currentState.c.o c4eef1ff589ab182
1 214 1706706276608460832 CMakeFiles/pmuw_projekt_notebinder.dir/src/main/c/Hangman/playHangman.c.o f2e2af7048638ee6
1 214 1706706276607344137 CMakeFiles/pmuw_projekt_notebinder.dir/src/main/c/Hangman/drawHangman.c.o de5f7edc6c2379d7
1 214 1706706276607374928 CMakeFiles/pmuw_projekt_notebinder.dir/src/main/c/Hangman/rules.c.o cdaff7b94c55641c
1 214 1706706276607365429 CMakeFiles/pmuw_projekt_notebinder.dir/src/main/c/Hangman/initializeHangman.c.o 7d64de4520ec9e97

BIN
cmake-build-debug/CMakeFiles/pmuw_projekt_notebinder.dir/src/main/c/Hangman/word_selector.c.o

9
src/main/c/Hangman/playHangman.c

@ -46,14 +46,17 @@ void playHangman(char *wordToGuess) {
mistakes++;
}
// Check if the player guessed all the letters
// 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);
break;
}
// Lose: Print the answer + game over
if (mistakes == MAX_MISTAKES){
currentState(currentGuess, mistakes);
printf("Oops! You have no more guesses :( \n The answer was: %s \n", wordToGuess);
}
}
}

1
src/main/c/Hangman/playHangman.h

@ -9,4 +9,5 @@
#include "initializeHangman.c"
#include "rules.c"
#include "currentState.c"
#include "drawHangman.c"
#endif //PMUW_PROJEKT_NOTEBINDER_PLAYHANGMAN_H
Loading…
Cancel
Save