Letter-guess colors are wrong when a word has the same letter twice
Your word game marks a letter as present although the secret word has no more of it, and players call it a lie. Two passes over the guess fix it, and the order of those passes is the part that most AI drafts get backwards.
Why this works
Each letter of the secret word can be matched once. Giving exact places their letters first, and only then handing out the leftovers, makes every color true and stops a wrong spot from stealing a right one.
When not to use it
Skip it if your game shows a plain count of matching letters and nothing per position.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- A diagram of every state
- 25 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 "Letter-guess colors are wrong when a word has the same letter twice" (read_entry letter-guess-colors-wrong-with-double-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