|
|
@ -52,6 +52,10 @@ void hangman() |
|
|
|
{ |
|
|
|
printf("Bitte gib einen Buchstaben ein!\n"); |
|
|
|
scanf(" %c", &userSelection); |
|
|
|
if(userSelection == '0') |
|
|
|
{ |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
letterGuessed(userSelection, guessWord, length, displayWord); |
|
|
|
changeLetter(userSelection, guessWord, length, displayWord); |
|
|
@ -110,6 +114,7 @@ bool letterGuessed(char x, char y[], int length, char ptr[]) |
|
|
|
} |
|
|
|
if(counter>0) |
|
|
|
{ |
|
|
|
printf("Dein gewaehlter Buchstabe %c war ein Treffer!\n", x); |
|
|
|
return true; |
|
|
|
} |
|
|
|
else |
|
|
@ -135,7 +140,6 @@ void changeLetter(char x, char y[], int length, char ptr[]) |
|
|
|
{ |
|
|
|
ptr[i] = x+32; |
|
|
|
} |
|
|
|
printf("Dein gewaehlter Buchstabe %c war ein Treffer!\n", x); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
@ -149,7 +153,6 @@ void changeLetter(char x, char y[], int length, char ptr[]) |
|
|
|
else { |
|
|
|
ptr[i] = x; |
|
|
|
} |
|
|
|
printf("Dein gewaehlter Buchstabe %c war ein Treffer!\n", x); |
|
|
|
} |
|
|
|
} |
|
|
|
} |