Browse Source

refactoring: add_guessed_letter --> erratene_buchstaben_hinzufuegen

main^2
Peter Wiebe 11 months ago
committed by Peter Wiebe
parent
commit
2c51cf5cbe
  1. 6
      src/main/c/hangman.c

6
src/main/c/hangman.c

@ -14,7 +14,7 @@ void nameAusgeben();
void levelauswahl(); void levelauswahl();
void hauptSpiel(int level); void hauptSpiel(int level);
void zeichne_galgen(int versuche); void zeichne_galgen(int versuche);
void add_guessed_letter(char* guessed_letters, char guessed_letter);
void erratenen_buchstaben_hinzufuegen(char* guessed_letters, char guessed_letter);
char eingabe_buchstabe(); char eingabe_buchstabe();
void lade_secret_word(char* secret_word, int level, char* path); void lade_secret_word(char* secret_word, int level, char* path);
void show_letters(char secret_word[100], char guessed_letters[100]); void show_letters(char secret_word[100], char guessed_letters[100]);
@ -184,7 +184,7 @@ void hauptSpiel(int level){
guessed_letter = eingabe_buchstabe(); guessed_letter = eingabe_buchstabe();
result = letter_in_secret_word(guessed_letter, secret_word); result = letter_in_secret_word(guessed_letter, secret_word);
if (result == 0){ if (result == 0){
add_guessed_letter(guessed_letters, guessed_letter);
erratenen_buchstaben_hinzufuegen(guessed_letters, guessed_letter);
} }
else { else {
versuche++; versuche++;
@ -270,7 +270,7 @@ void zeichne_galgen(int versuche) {
} }
} }
void add_guessed_letter(char* guessed_letters, char guessed_letter){
void erratenen_buchstaben_hinzufuegen(char* guessed_letters, char guessed_letter){
for (int i = 0; i < strlen(guessed_letters); i++){ for (int i = 0; i < strlen(guessed_letters); i++){
if (guessed_letters[i] == guessed_letter){ if (guessed_letters[i] == guessed_letter){
return; return;

Loading…
Cancel
Save