Colouring a word guess goes wrong when a letter appears twice
Mark each letter right, misplaced or absent and it works until a guess repeats a letter the secret has only once, and then players are told something false. This entry shows the order of marking that keeps every colour honest and how the on-screen keyboard should remember them.
Why this works
Each letter of the secret can vouch for only one letter of the guess. So the exact matches claim their letters first, and only what is left over can be marked as misplaced, which is why the order of the two passes matters.
When not to use it
If your game shows only how many letters are right, or hides which position is which, the colours are not needed. And in a game where hints should be vague on purpose, giving exact feedback per letter makes the puzzle too easy.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- A diagram of every state
- 31 lines of example code with 4 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Colouring a word guess goes wrong when a letter appears twice" (read_entry word-guess-colours-repeated-letters) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP