The computer has hidden a code of coloured pegs behind the shield. Fill the lit row by clicking colours (or pressing 1–8), then Check it (Enter). Each black key peg means a peg of the right colour in the right hole; each white one, a right colour in the wrong hole. The key pegs don't say which pegs they belong to. Click a placed peg, or press Backspace, to take it back. Crack the code before you run out of rows. Change the number of pegs and colours from the New Game menu.
Game options
Beginner: 4 pegs from 6 colours, no colour used twice, and 12 guesses. There are 360 possible codes.
Classic: the 1970 original, with 4 pegs from 6 colours, repeats allowed, and 10 guesses. There are 1,296 possible codes.
Super Mastermind: 5 pegs from 8 colours, repeats allowed, and 12 guesses. There are 32,768 possible codes.
Tips and strategy
Open with two colours in pairs, such as red, red, blue, blue. In 1977 Donald Knuth showed that, starting this way, every Classic code can be cracked in five guesses or fewer.
Add up the black and white key pegs to learn how many of your colours are in the code, wherever they sit. Use the first few guesses to find the colours, then work out where they go.
Make every guess fit all the feedback so far. A guess that can't be the code wastes a row.
To pin down positions, change one or two pegs at a time and see how the key pegs change.
In Beginner no colour repeats, so four key pegs in total means you have all the right colours and only need to sort them.