What is Mastermind?
Mastermind is a code-breaking game for one guesser against a hidden code. The code is a row of coloured pegs — four in the classic game — and each position is chosen from a fixed set of colours. Colours may repeat, so the same colour can appear more than once, or not at all.
You break the code by making guesses. After each guess you are given clue pegs: one black peg for every peg that is the right colour in the right position, and one white peg for every peg that is the right colour but in the wrong position. The clues are never tied to a particular slot, so deciding which peg earned which clue is the whole challenge.
- The hidden code is a row of coloured pegs.
- Each slot is one colour from the palette; colours can repeat.
- A black clue: right colour, right place.
- A white clue: right colour, wrong place.
- Crack the exact code before the rows run out to win.
How to play here
Tap a colour in the palette and it drops into the next empty slot of your current row, filling from the left. Tap a peg you have already placed to take it back out, or use Clear to empty the whole row. When all the slots are full, press Check to score the guess.
Your clues then appear beside the row as dark and light feedback pegs, and the completed guess stays on the board so you can compare it with the next one. The counter at the top shows how many rows you have left.
- Tap palette colours to fill the row from the left.
- Tap a placed peg to remove it; Clear empties the row.
- Press Check to score a full row.
- Dark pegs = right colour and place; light pegs = right colour only.
- Watch the guesses-left counter and choose your levels.
Reading the feedback
The clue pegs are unordered: a row scored with one black and two white pegs tells you that, in total, one peg is perfect and two more are right colours sitting in the wrong slots — but not which ones. The skill is turning that summary into placement.
Add the black and white pegs together and you learn how many of your guessed colours appear in the code at all. If a four-peg guess scores nothing, none of those colours is used; if it scores four pegs of any kind, every colour you played is in the code somewhere.
- Total clue pegs = how many of your colours the code contains.
- Black pegs alone tell you how many are perfectly placed.
- Zero clues means none of those colours is used — a big elimination.
- Clues never say which slot, so combine several rows.
- Repeated colours are counted to their multiplicity, no more.
A deduction strategy
Strong players spend the first guesses gathering information rather than trying to win outright. A useful opening is to test colours in pairs or to play a row of a single colour, which immediately tells you how many of that colour the code holds. A couple of such probes can pin down the exact colour content.
Once you know which colours are present and how many of each, switch to placement. Change one peg at a time and watch a white clue turn black to lock a colour into its slot. Keep a mental list of what every row has ruled out — careful Mastermind is pure logic, and a known method by Donald Knuth guarantees the four-colour code in five guesses or fewer.
Difficulty levels and why play online
Easy hides a four-peg code drawn from six colours — the classic game and the best place to learn to read the clues. Medium keeps four pegs but widens the palette to eight colours, while Hard stretches the code to five pegs and Expert to six, each with eight colours and a few extra rows to work in.
Playing online does the bookkeeping for you: the clues are scored instantly and exactly, every past guess stays visible for comparison, the timer tracks your solve and your game saves locally so you can return to a tricky code. With repeats allowed and no hints, it is your reasoning against the board.
- Easy: a 4-peg code from 6 colours, 10 rows.
- Medium: a 4-peg code from 8 colours, 10 rows.
- Hard: a 5-peg code from 8 colours, 12 rows.
- Expert: a 6-peg code from 8 colours, 12 rows.






