fix win bug

This commit is contained in:
bePrivate
2023-10-28 20:24:04 +02:00
parent 2a8ec77b05
commit a98f2e0059
2 changed files with 2 additions and 3 deletions
+2 -3
View File
@@ -182,7 +182,7 @@ int search_word(char word[], char target) {
evaluate the loss
*/
void eval_lose() {
if (turns >= 6) {
if (turns >= 6 && win == 0) {
lose = 1;
}
}
@@ -234,6 +234,7 @@ void eval_word(char word[]) {
printf("\n%d\n", search_wordlist(wordlist, word));
if (search_wordlist(wordlist, word) != -1) {
eval_win(search_wordlist(wordlist, word));
eval_lose();
eval_props(word); // eval correct/incorrect/oop letters
put_word_into_playfield(word);
} else {
@@ -241,8 +242,6 @@ void eval_word(char word[]) {
printf("Word %s not in wordlist\n", word);
sleep(2);
}
eval_lose();
}
/*