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