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
- Choose how many pegs and colours to play with and whether colours may repeat.
- 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.
- 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.
Who invented Mastermind?
Mordecai Meirowitz, an Israeli postmaster and telecommunications expert, invented it in 1970, and the British company Invicta Plastics brought it out in the early 1970s. It resembles an older pencil-and-paper game, Bulls and Cows, played with digits instead of coloured pegs.
How many possible codes are there in Mastermind?
With 4 pegs and 6 colours there are 1,296 codes when colours may repeat and 360 when they may not. Donald Knuth showed in 1977 that any of them can be cracked in five guesses or fewer. Switch the mode to let the computer crack your code with a similar worst-case strategy.
Mastermind: how do I record a video?
Press the red Record button in the playback bar: it films what the stage shows. Press it again to stop, and the video is saved to your device.Recording is free; you only need to sign in. Without a subscription the video carries a small PictorX logo in a corner.The button beside Record opens the video options: the shape (as shown, square, story 9:16 or wide 16:9), the length (until you stop, or 5, 10, 15 or 30 seconds for social media) and the file: MP4, WebM or an animated GIF.For the sound, choose the app's own sounds or one of three music tracks: calm, bright or beat.
Ready to try it?
Open PictorX in your browser — no install, no credit card required to start.
前往編輯器