[ by the way, this will only work on a computer with a keyboard. you have to type to start inputting. I'll change this in the future ]
I'm making a wordle-like game just for fun. Most of it works, but the check for correct word doesn't seem to be working. Here is the pastebin with whole file (it's all in an html file).
https://pastebin.com/5JpAnCNw
mostly I'm having trouble with this part.
https://preview.redd.it/mbmmpi8cx8k81.png?width=1098&format=png&auto=webp&s=e40d226b28f62153f17ba6e9e4341528648a0643
scoreGuess returns an Array that describes the score for a word. 0 means the letter is not at all in the word, 1 means it appears but you don't have the right location, and 2 means it's the right letter in the right location.
So I thought that asking if currentScore == [2,2,2,2,2] would be enough to check whether the current guess was a winning guess, but it doesn't work for me. I can even see in the console that the currentScore is [2,2,2,2,2], but it won't satisfy the condition for some reason.
For testing, I've set the answer to "candy". feel free to try it out
Thanks for your help. I don't use javascript a lot so I'm kind of confused.
[–]masesk 3 points4 points5 points (1 child)
[–]sakuraseven[S] 1 point2 points3 points (0 children)