Browse Source

refactoring: show_letters --> zeige_Buchstabenfeld

remotes/origin/peter^2
Peter Wiebe 11 months ago
parent
commit
416d01bce7
  1. 6
      src/main/c/hangman.c

6
src/main/c/hangman.c

@ -18,7 +18,7 @@ void zeichne_galgen(int versuche);
void erratenen_buchstaben_hinzufuegen(char* guessed_letters, char guessed_letter); 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 show_letters(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 letter_in_secret_word(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();
@ -181,7 +181,7 @@ void hauptSpiel(int level){
while (versuche < 6 && won == 0) { while (versuche < 6 && won == 0) {
zeichne_galgen(versuche); zeichne_galgen(versuche);
show_letters(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 = letter_in_secret_word(guessed_letter, secret_word);
if (result == 0){ if (result == 0){
@ -311,7 +311,7 @@ void hole_zu_erratendes_wort(char* secret_word, int level, char* path){
} }
} }
void show_letters(char secret_word[100], char guessed_letters[100]){
void zeige_Buchstabenfeld(char secret_word[100], char guessed_letters[100]){
printf("Erratene Buchstaben: "); printf("Erratene Buchstaben: ");
for(int i = 0; i < strlen(secret_word); i++) { for(int i = 0; i < strlen(secret_word); i++) {
if(strchr(guessed_letters, secret_word[i])){ if(strchr(guessed_letters, secret_word[i])){

Loading…
Cancel
Save