-
Notifications
You must be signed in to change notification settings - Fork 242
Open
Description
It is proposed that guessed words be stored in the app's local storage and not used as challenges anymore. Code changes to Game.tsx:
var usedWords = JSON.parse(localStorage.getItem('usedWords') || '[]');
function randomTarget(wordLength: number): string {
const eligible = targets.filter((word) => word.length === wordLength
&& !(usedWords.includes(word)));
. . .
const onKey = (key: string) => {
. . .
const saveUsedWord = (word: string) => {
usedWords.push(target);
localStorage.setItem('usedWords', JSON.stringify(usedWords));
};
if (currentGuess === target) {
setHint(gameOver("won"));
setGameState(GameState.Won);
saveUsedWord(target);
}
. . .
Metadata
Metadata
Assignees
Labels
No labels