Actualiser pendu.c

This commit is contained in:
Yanis DARIUS 2024-10-24 15:44:59 +02:00
parent 11f44821bf
commit 227f77d89d

View File

@ -109,11 +109,11 @@ int play_game(const char *word, int word_length) {
char guess; char guess;
alarm(30); alarm(30);
printf("Entrez une lettre (ou 'q' pour quitter) : "); printf("Entrez une lettre (ou '1' pour quitter) : ");
scanf(" %c", &guess); scanf(" %c", &guess);
alarm(0); alarm(0);
if (guess == 'q') { if (guess == '1') {
printf("Vous avez quitté le jeu. À bientôt !\n"); printf("Vous avez quitté le jeu. À bientôt !\n");
return 0; return 0;
} }
@ -167,7 +167,7 @@ int main() {
char word[256] = ""; char word[256] = "";
choose_random_words(filtered_words, num_filtered_words, word, max_word_length); choose_random_words(filtered_words, num_filtered_words, word, max_word_length);
int word_length = strlen(word); int word_length = strlen(word);
printf("%s",word) printf("%s",word);
int score = play_game(word, word_length); int score = play_game(word, word_length);
char play_again; char play_again;