From ab01bb06cf041ccf14287ee33158e69038ad585d Mon Sep 17 00:00:00 2001 From: Rushil Umaretiya Date: Wed, 29 May 2024 00:11:20 -0400 Subject: [PATCH] fixed lose condition --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index d9e7bc5..ff6e5ed 100644 --- a/index.js +++ b/index.js @@ -160,6 +160,7 @@ let handleGuess = () => { } }, 300 * (i + 1) + 300); } + console.log(GUESSES, guesses.length); if (lockedGuess === currentWord) { running = false; @@ -180,7 +181,7 @@ let handleGuess = () => { origin: { y: 0.6 }, }); }, 2000); - } else if (guesses.length === GUESSES) { + } else if (guesses.length == GUESSES - 1) { running = false; setTimeout(() => {