From f2270bb1b5fcb62a322a9d21c1403260a6da8de0 Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Fri, 8 Mar 2024 18:25:29 +0000 Subject: Implement guessable list (larger than solutions list) --- script.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'script.js') diff --git a/script.js b/script.js index dad4b58..b9e8bc7 100644 --- a/script.js +++ b/script.js @@ -14,6 +14,12 @@ fetch(url) .then(wordlist => wordlist.split('\n')) .then(wordlist => main(wordlist)); +let guessable = [] +fetch("guessable") +.then(response => response.text()) +.then(wordlist => wordlist.split('\n')) +.then(function(g){guessable = g;}) + function addGuessDisplay(answer, guess, len, hint) { let cat = "" @@ -36,7 +42,7 @@ function checkAnswer(event, answer, len, wordlist) { input.value = input.value.toLowerCase(); if (!exit) { - if (wordlist.includes(input.value)) { + if (wordlist.includes(input.value) || guessable.includes(input.value)) { addGuessDisplay(answer, input.value, len, hint); tries++; if (input.value == answer) { -- cgit 1.4.1