|
|
@ -114,12 +114,12 @@ void hangman() |
|
|
|
countWrongGuess++; |
|
|
|
printf("Der von dir getippte Buchstabe war falsch! Du hast noch %d Versuche.\n", POSSIBLE_TRYS-countWrongGuess); |
|
|
|
} |
|
|
|
if(userSelection == '0'||wordGuessed(guessWord, displayWord)||noTrysLeft(countWrongGuess)) |
|
|
|
changeLetter(userSelection, guessWord, length, displayWord); |
|
|
|
drawHangman(countWrongGuess); |
|
|
|
if(userSelection == '0'||wordGuessed(guessWord, displayWord)||noTrysLeft(countWrongGuess,guessWord)) |
|
|
|
{ |
|
|
|
break; |
|
|
|
} |
|
|
|
changeLetter(userSelection, guessWord, length, displayWord); |
|
|
|
drawHangman(countWrongGuess); |
|
|
|
printf("\n\n%s\n", displayWord); |
|
|
|
} |
|
|
|
|
|
|
@ -143,7 +143,7 @@ bool wordGuessed(char x[], char y[]) |
|
|
|
{ |
|
|
|
if(strcmp(x,y) == 0) |
|
|
|
{ |
|
|
|
printf("Du hast gewonnen!\n"); |
|
|
|
printf("Du hast gewonnen!\nDas gesuchte Wort war \"%s\"\n\nHier hast du ein neues Wort zum erraten.\n\n",x); |
|
|
|
return true; |
|
|
|
} |
|
|
|
else |
|
|
@ -174,7 +174,7 @@ bool letterGuessed(char x, char y[], int length) |
|
|
|
} |
|
|
|
if(counter>0) |
|
|
|
{ |
|
|
|
printf("Dein gewaehlter Buchstabe %c war ein Treffer! Du hast noch %d Versuche.\n", x); |
|
|
|
printf("Dein gewaehlter Buchstabe %c war ein Treffer!\n", x); |
|
|
|
return true; |
|
|
|
} |
|
|
|
else |
|
|
@ -222,11 +222,11 @@ void drawHangman(int x) |
|
|
|
printf("%s", hangmanStages[x]); |
|
|
|
} |
|
|
|
|
|
|
|
bool noTrysLeft(int x) |
|
|
|
bool noTrysLeft(int x, char y[]) |
|
|
|
{ |
|
|
|
if(x == POSSIBLE_TRYS) |
|
|
|
{ |
|
|
|
printf("Du hast verloren!\n\n"); |
|
|
|
printf("Du hast verloren!\n\nDas gesuchte Wort war \"%s\"\n\nHier hast du ein neues Wort zum erraten.\n\n",y); |
|
|
|
return true; |
|
|
|
} |
|
|
|
else |
|
|
|