about summary refs log tree commit diff
path: root/script.js
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@librem.one>2024-03-08 18:25:29 +0000
committerZach DeCook <zachdecook@librem.one>2024-03-08 18:25:29 +0000
commitf2270bb1b5fcb62a322a9d21c1403260a6da8de0 (patch)
tree97e450eaa1ac4936e26e5ab6f94deb8bbacfc6ce /script.js
parent35021105b921b3a3350616718d15c491688ab535 (diff)
downloadpurple-f2270bb1b5fcb62a322a9d21c1403260a6da8de0.tar.gz
Implement guessable list (larger than solutions list)
Diffstat (limited to 'script.js')
-rw-r--r--script.js8
1 files changed, 7 insertions, 1 deletions
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) {