More about Mastermind

Mastermind

The computer hides a row of coloured pegs. Make a guess and the feedback pegs tell you how many colours are in the right place and how many are right but in the wrong place. Crack the code before you run out of rows. Pick colours for each hole and press Check.

How it works

  1. Choose how many pegs and colours to play with and whether colours may repeat.
  2. Pick a colour for each hole, then press Check. A black peg means right colour in the right place, a white peg means right colour in the wrong place.
  3. Use the feedback to narrow down the code, or switch the mode to let the computer crack a code you choose.

The rules

The codemaker hides a code of coloured pegs. The codebreaker guesses a code and gets one black peg for each peg of the right colour in the right place and one white peg for each right colour in the wrong place. The order of the feedback pegs gives nothing away.

How the computer breaks your code

The computer keeps a list of every code that still fits all the feedback so far. With small sets it picks the guess that leaves the fewest possibilities in the worst case, so a 4 peg, 6 colour code usually falls in four or five guesses.

Levels

Easy uses 4 pegs, 6 colours and no repeats. Medium allows repeated colours. Hard uses 5 pegs and 8 colours. Change any setting to play a custom game.

Frequently asked questions

What do the black and white pegs mean?

Black means a peg of the right colour in the right place. White means the colour is in the code but in a different place.

How many guesses do I get?

You get 10 rows with 4 pegs and 12 rows with 5 or 6 pegs.

Is it free?

Yes. Mastermind on PictorX is free, runs in your browser and needs no sign-up.

Ready to try it?

Open PictorX in your browser — no install, no credit card required to start.

Go to Editor