
Mastermind is a two-player code breaking game: one side hides a four-peg code, the other guesses it, and each guess earns clues for exact matches and colour-only matches. In the online version, the computer makes the code and you have ten guesses.
The game has no cards, no draw pile, and no hidden scoring system. A standard board gives the code-breaker ten rows, with four peg spaces in each row and a small feedback area beside each guess. The secret code uses four positions chosen from six colours. Repeats are allowed, so the same colour can appear more than once. That makes 1,296 possible codes.
A turn is short: choose four pegs, submit them, read the clues, then rule out what cannot be true. You win by matching the whole code before the tenth guess is used. If all ten guesses are wrong, the code-maker wins. These Mastermind rules are simple to state, but each clue changes what can still be true.
What are the rules of Mastermind, in one clean read?
Mastermind is played between a code-maker and a code-breaker. In a physical game, both are people. In an online game, the computer usually acts as the code-maker, and you take the guesses. The code-maker secretly chooses a row of four pegs, each chosen from six colours. Repeated colours are allowed, so red-red-blue-green is a legal shape of code if those colours are available.
The code-breaker has a board of ten guess rows. Each row has four spaces, matching the four positions in the secret code. On your turn, you fill all four spaces and submit the guess. The code-maker then gives feedback, but never reveals which exact guessed peg earned which clue.
A clue for an exact match means one guessed peg has the right colour in the right position. A clue for a colour-only match means one guessed peg has a colour that appears in the code, but in a different position. Extra copies of a colour do not earn extra clues unless the secret code also contains extra copies.
The game ends as soon as the code-breaker guesses all four positions correctly, or after the tenth wrong guess. There is no score pile and no card count. In a single puzzle, the practical score is the row you solved it on; if you do not solve it in ten, the result is a loss.
How do you set up the board and choose the code?
- Choose the roles. Mastermind needs two sides: the code-maker and the code-breaker. With an online board, the computer is the code-maker. You are the code-breaker.
- Prepare the guess rows. The board needs ten rows for guesses. Each row has four main peg spaces, because every guess must be a complete four-peg attempt. Beside each row is space for up to four clues.
- Set the colour supply. The version described here uses six possible colours. Because the code has four positions, and each position can use any of the six colours, there are 1,296 possible codes.
- Allow repeated colours. This matters. A code can use the same colour twice, three times, or four times. If repeats were banned, the puzzle would be much smaller and the clues would mean something different.
- Hide the answer. The code-maker chooses the four-peg secret code and keeps it out of sight. On Veena Games, the pegs are also lettered, so colour is never the only clue on the screen. The code-breaker sees only their own guesses and the feedback after each row.
No player draws cards, takes tricks, or collects points during setup. Once the code is fixed and hidden, play begins with the first full four-peg guess.
What happens on a turn?
A Mastermind turn has three parts: make a complete guess, receive clues, and change your next guess because of those clues. You cannot submit half a row. You are testing a full possible answer every time.
- Pick four pegs. Choose a colour for each of the four positions. The order matters. Blue-green-red-yellow is a different guess from green-blue-red-yellow.
- Submit the row. Once the row is played, it stands as a record. You can compare later guesses against it, which is where most of the deduction happens.
- Read the feedback. The code-maker gives one clue for each peg that can be matched to the secret code. Exact-position matches are stronger than colour-only matches, and each secret peg can be counted only once.
- Plan the next row. Keep what is proven, move what is only partly proven, and remove colours that the clues have made impossible. Be careful with duplicates; a missing second clue often tells you that the second copy is wrong.
The first guess is often used to gather information rather than to be clever. For example, a guess with repeated colours can test whether a colour appears more than once, but it also spends a whole row on a narrow question. A guess with four different colours tests breadth. Neither approach is a rule; both are ways to ask the board a question.
The win condition is exact: four correct colours in four correct positions. If that happens on any row from one to ten, the game ends immediately.
How do the clues work, and what do they actually tell you?
The clues make Mastermind work. They tell you how close a guess is, but not which pegs did the work. That missing link forces you to compare rows. Standard rules often use black clues for exact matches and white clues for colour-only matches; the names matter less than the meaning.
| Clue or situation | What it means | How to use it |
|---|---|---|
| Exact-position clue | One guessed peg is the right colour in the right slot. | Treat that position as a serious candidate, but prove it again before freezing the rest of your plan. |
| Colour-only clue | One guessed peg is in the code, but not where you placed it. | Keep that colour in play and move it to another position on a later row. |
| Fewer clues than pegs | At least one guessed peg did not match the secret code after duplicates were counted. | Look for colours or extra copies that can be cut from future guesses. |
| Clues shown without positions | The first clue does not belong to the first peg. Clue order is not a map. | Compare whole rows rather than attaching each clue to the nearest peg. |
| Duplicate colours | A colour can score only as many times as it appears in the hidden code. | If two reds earn one clue, one red may be useful and the other may be noise. |
Good players do not read a clue on its own. They read it against the last two or three rows. Changing one position at a time can give clean evidence, but it can also be slow. Changing several things asks a bigger question and makes the answer harder to unpack.
Why does this code breaking game stay worth another try?
Mastermind stays interesting because the rules are small and the search space is large enough to matter. Four positions from six colours gives 1,296 possible hidden codes, and ten guesses is not a lot once you start wasting rows. The board looks tidy. The problem is not.
Every guess says two things at once: what you think the code might be, and what information you want if you are wrong. That is the sharp part. A wild guess can still teach you something. A neat-looking guess can be useless if it repeats a question the board has already answered.
The game also punishes lazy certainty. One exact clue does not tell you which peg is exact. Two colour-only clues do not tell you which two colours they belong to if your guess contained a duplicate. You have to respect the limits of the evidence. That makes the eventual solve feel earned, especially when the answer looked impossible three rows earlier.
There is luck in the hidden code you receive, but the better player uses fewer guesses over time. You learn to test colours, isolate positions, and stop clinging to a favourite theory when the clues disagree. A good puzzle ends with a click, not a flourish.
Frequently asked questions
Yes. Repeated colours are allowed in the standard Veena Games Mastermind setup, so a code can be AABC, AABB, AAAA, or any other four-peg pattern made from the six available colours. This is why the full set is 1,296 possible codes, not just the arrangements with four different colours.
1,296 possible codes come from four slots and six choices for each slot. The first peg has six options, the second has six, and so on, so the count is 6 × 6 × 6 × 6. Repeats are included in that total, which is the usual source of surprise for new players.
The common misconception is that a clue peg points to the guessed peg beside it. It does not. The clues only tell you the total number of exact matches and colour-only matches in the whole row. If you get two useful clues, you still have to work out which two guessed pegs caused them.
A concrete position helps: guess AABB and receive one exact match and one colour-only match. You now know that some combination of A and B is involved, but not which peg gave which clue. AABB is popular because it tests two colours while also checking whether repeats might matter. It is not magic, but it gives tidy information.
It depends on your aim: whether you want the smallest possible worst case or a method you can run in your head without turning the game into paperwork. A strict elimination method is strongest, but slower. A practical human method is to test colours first, then lock positions once you know which colours belong in the code.
Bulls and Cows is the closest relative on Veena Games, but it usually feels sharper because digits carry their own order and the feedback language is different. Mastermind uses four pegs from six colours, with exact and colour-only clues. The family resemblance is clear: both games reward eliminating possibilities rather than guessing on instinct.
Play the row as it stands once it has been scored; the exception is the moment before scoring, when a physical player may still move pegs around. After the clues appear, that guess is part of the evidence. Treating it as fixed is what makes the puzzle fair across all ten guesses.
Most people go wrong by counting the same hidden peg twice. If the code has one A and your guess has two As, only one of those guessed As can score. Exact matches are counted first, then colour-only matches are counted from what remains. This prevents one real peg from producing two separate clues.
An exact match means one guessed peg has both the right colour and the right position. A colour-only match means the colour is somewhere in the code, but not in that slot. The clue total is about the whole row, not peg by peg, so three clues means three of your four guessed pegs are useful in some way.
Start each game by testing colours, then stop wasting guesses on colours you have proved absent. Keep one row as a reference and change only one or two things at a time, so the new clues mean something. When you get several clues, resist the urge to celebrate. Use the next guess to separate colour from position.
Final thoughts
If you are new, do not try to feel clever on the first row. Use it to get evidence. Four different colours gives a broad first reading; repeated colours asks a narrower question about copies. Both can be sensible. What matters is that your second row has a reason.
The common mistake is treating a clue as if it points at a peg. It does not. A row with two clues tells you that two matchable things exist somewhere in that guess. It does not name them. Write the row in your head as a claim, then test the smallest useful change you can make. Swap two positions. Replace one colour. Try one duplicate. The board will start arguing with you.
Also, let go quickly. If a theory needs three excuses to survive, it is probably wrong. Mastermind rewards calm subtraction more than dramatic insight. Remove what cannot fit. Keep what keeps surviving. By the later rows, the code often has fewer hiding places than it feels like.
The pleasure is in that tightening net: ten rows, four slots, and a set of clues that never says quite enough until, suddenly, it does.

