Objective
Mastermind is a code-breaking game. One player is the Codemaker, who creates a secret
pattern of 4 colored pegs. The other is the Codebreaker, who tries to guess the pattern
within 10 turns.
Gameplay
- Set the Code: Under the bottom teal shield, place 4 pegs of any color combination from
the palette.
- Lock & Solve: Lock the code by closing the shield or clicking "Start Game". The AI Solver
will then logically deduce your code row-by-row using an elimination constraint solver.
- Step-by-Step: Click "AI Guess Step" to run each AI deduction and watch the elimination
logic live!
Feedback Pegs (Key Pegs)
After each guess, feedback is displayed in the 2x2 grid to the right of the row:
- ● Red Peg: One of your pegs is correct in both
color and position.
- ● White Peg: One of your pegs is correct in
color but in the wrong position.
- Empty Slot: No matching peg exists in the secret code for remaining slots.
Note: The feedback pegs do not correspond to specific socket positions; they are
simply counts of correctness.