Add win state
This commit is contained in:
parent
7d4120447a
commit
083e595d2a
1 changed files with 4 additions and 0 deletions
|
|
@ -24,6 +24,10 @@ const route: ServerRoute = {
|
||||||
|
|
||||||
if (data.key[guess] != null) {
|
if (data.key[guess] != null) {
|
||||||
data.current = addLetter(data.key, data.current, guess);
|
data.current = addLetter(data.key, data.current, guess);
|
||||||
|
|
||||||
|
if (data.current == data.solution) {
|
||||||
|
return `Congrats! You won. Merry Chatmanmas!`;
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
data.incorrect++;
|
data.incorrect++;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue