Only mark letters without matches
Fixes #7 (closed)
Instead of checking if each letter guess is in the correct, make a copy of the correct word, and remove from the copy each match
- Find exact matches:
. | . | . | . | . | . |
---|---|---|---|---|---|
correct | C | R | E | D | S |
written | C | R | E | E | D |
- Then check the remaining letters
. | . | . | . | . | . |
---|---|---|---|---|---|
correct | D | S | |||
written | E | D |
With the current algorithm the result is 🟩🟩🟩🟨🟨, which is wrong because the correct word only has one E. With this new one it would be 🟩🟩🟩