diff --git a/src/Game.tsx b/src/Game.tsx index 89a63b8b7..3ca5a73c6 100644 --- a/src/Game.tsx +++ b/src/Game.tsx @@ -135,6 +135,10 @@ function Game(props: GameProps) { setCurrentGuess((guess) => (guess + key.toLowerCase()).slice(0, wordLength) ); + if ((currentGuess.length + 1) === wordLength && !dictionary.includes(currentGuess + key.toLowerCase())) { + setHint("Not a valid word"); + return; + } tableRef.current?.focus(); setHint(""); } else if (key === "Backspace") {