From 8c500778398edaf2cbbd1e7a6151ec66925caf00 Mon Sep 17 00:00:00 2001 From: Peter Wiebe Date: Wed, 7 Feb 2024 09:45:04 +0100 Subject: [PATCH] refactoring: attempts --> versuche --- src/main/c/hangman.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/c/hangman.c b/src/main/c/hangman.c index 03667c1..ad7a86f 100644 --- a/src/main/c/hangman.c +++ b/src/main/c/hangman.c @@ -170,7 +170,7 @@ void levelauswahl(){ void hauptSpiel(int level){ char secret_word[100]; - int attempts = 0; + int versuche = 0; char guessed_letter; char guessed_letters[100]; char path[] = "hangman_words.txt"; @@ -179,8 +179,8 @@ void hauptSpiel(int level){ lade_secret_word(secret_word, level, path); - while (attempts < 6 && won == 0) { - draw_hangman(attempts); + while (versuche < 6 && won == 0) { + draw_hangman(versuche); show_letters(secret_word, guessed_letters); guessed_letter = eingabe_buchstabe(); result = letter_in_secret_word(guessed_letter, secret_word); @@ -188,7 +188,7 @@ void hauptSpiel(int level){ add_guessed_letter(guessed_letters, guessed_letter); } else { - attempts++; + versuche++; } won = has_won(secret_word, guessed_letters); } @@ -197,12 +197,12 @@ void hauptSpiel(int level){ } } -void draw_hangman(int attempts) { +void draw_hangman(int versuche) { clear_screen(); printf("Galgenmann!\n"); printf("v.1.0.2\n\n"); - switch(attempts) { + switch(versuche) { case 0: printf(" _______\n"); printf(" | |\n");