Browse Source

refactoring: letter_in_secret_word --> Buchstabe_im_zu_erratenden_wort

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

6
src/main/c/hangman.c

@ -18,7 +18,7 @@ void erratenen_buchstaben_hinzufuegen(char* guessed_letters, char guessed_letter
char eingabe_buchstabe(); char eingabe_buchstabe();
void hole_zu_erratendes_wort(char* secret_word, int level, char* path); void hole_zu_erratendes_wort(char* secret_word, int level, char* path);
void zeige_Buchstabenfeld(char secret_word[100], char guessed_letters[100]); void zeige_Buchstabenfeld(char secret_word[100], char guessed_letters[100]);
int letter_in_secret_word(char guessed_letter, char secret_word[100]);
int buchstabe_im_zu_erratenden_wort(char guessed_letter, char secret_word[100]);
int has_won(char secret_word[100], char guessed_letters[100]); int has_won(char secret_word[100], char guessed_letters[100]);
void level_plus(); void level_plus();
int overlay(); int overlay();
@ -182,7 +182,7 @@ void hauptSpiel(int level){
zeichne_galgen(versuche); zeichne_galgen(versuche);
zeige_Buchstabenfeld(secret_word, guessed_letters); zeige_Buchstabenfeld(secret_word, guessed_letters);
guessed_letter = eingabe_buchstabe(); guessed_letter = eingabe_buchstabe();
result = letter_in_secret_word(guessed_letter, secret_word);
result = buchstabe_im_zu_erratenden_wort(guessed_letter, secret_word);
if (result == 0){ if (result == 0){
erratenen_buchstaben_hinzufuegen(guessed_letters, guessed_letter); erratenen_buchstaben_hinzufuegen(guessed_letters, guessed_letter);
} }
@ -323,7 +323,7 @@ void zeige_Buchstabenfeld(char secret_word[100], char guessed_letters[100]){
printf("\n"); printf("\n");
} }
int letter_in_secret_word(char guessed_letter, char secret_word[100]){
int buchstabe_im_zu_erratenden_wort(char guessed_letter, char secret_word[100]){
for(int i = 0; i < strlen(secret_word); i++){ for(int i = 0; i < strlen(secret_word); i++){
if(guessed_letter == secret_word[i]){ if(guessed_letter == secret_word[i]){
return 0; return 0;

Loading…
Cancel
Save