If you’re playing a video game version, the computer will usually do this instead of a player. The code maker must put a peg in every hole. He has the option to use more than one peg of the same color. For example, he could put down Green Yellow Yellow Blue.

For example, she could put down Blue Orange Green Purple. (Your Mastermind game might have more holes or different colored pegs. )

Each white peg means that one of the guessed pegs is correct, but is in the wrong hole. Each red (or black) peg means that one of the guessed pegs is correct, and is in the right hole. The order of the white and black pegs does not matter.

Peg #1 is Blue. There is a blue in the code, but it is not in position #1. This earns a white hint peg. Peg #2 is Orange. There is no orange in the code, so no hint peg gets put down. Peg #3 is Green. There is a green in the code, and it is in position #3. This earns a red (or black) hint peg. Peg #4 is Purple. There is no purple in the code, so no hint peg gets put down.

Peg #1 is Blue. There is a blue in the code, but it is not in position #1. This earns a white hint peg. Peg #2 is Orange. There is no orange in the code, so no hint peg gets put down. Peg #3 is Green. There is a green in the code, and it is in position #3. This earns a red (or black) hint peg. Peg #4 is Purple. There is no purple in the code, so no hint peg gets put down.

Peg #1 is Blue. There is a blue in the code, but it is not in position #1. This earns a white hint peg. Peg #2 is Orange. There is no orange in the code, so no hint peg gets put down. Peg #3 is Green. There is a green in the code, and it is in position #3. This earns a red (or black) hint peg. Peg #4 is Purple. There is no purple in the code, so no hint peg gets put down.

The code breaker guesses Blue Yellow Orange Pink this time. The code maker checks this guess: Blue belongs but is in the wrong place; Yellow belongs and is in the right place; Orange doesn’t belong; Pink doesn’t belong. The code maker puts down one white hint peg and one red hint peg.

This isn’t the only strategy to use in Mastermind, but it’s an easy one to pick up. It will not work very well if your version has more than six colors to choose from.

This isn’t the only strategy to use in Mastermind, but it’s an easy one to pick up. It will not work very well if your version has more than six colors to choose from.

Blue Blue Blue Blue — no hint pegs. That’s fine, we’ll keep using Blue anyway. Blue Blue Green Green – one white peg. We’ll keep in mind that the code has one green, and it must be in the left half. Blue Blue Pink Pink — one black peg. We now know that one pink is in the code, in the right. Blue Blue Yellow Yellow – one white peg and one black peg. There must be at least two yellows in the code, one on the left and one on the right.

Blue Blue Blue Blue — no hint pegs. That’s fine, we’ll keep using Blue anyway. Blue Blue Green Green – one white peg. We’ll keep in mind that the code has one green, and it must be in the left half. Blue Blue Pink Pink — one black peg. We now know that one pink is in the code, in the right. Blue Blue Yellow Yellow – one white peg and one black peg. There must be at least two yellows in the code, one on the left and one on the right.

Blue Blue Blue Blue — no hint pegs. That’s fine, we’ll keep using Blue anyway. Blue Blue Green Green – one white peg. We’ll keep in mind that the code has one green, and it must be in the left half. Blue Blue Pink Pink — one black peg. We now know that one pink is in the code, in the right. Blue Blue Yellow Yellow – one white peg and one black peg. There must be at least two yellows in the code, one on the left and one on the right.

We know that Green Yellow Pink Yellow has a left half and right half that contain the correct pegs, but it turns out we get two white pegs and two black pegs in our results. This means one of the halves (either #1 and #2 need to switch places, or else #3 and #4 do). We try Yellow Green Pink Yellow and get four black pegs — the code is solved.

Red Red Blue Blue Result 1: no pegs: red and blue are not in the code Result 2: one white or black peg (let’s suppose a white peg). Either red or blue is in the code once. Blue Blue Blue Blue will give you a peg if it’s blue, or no pegs if it’s red (let’s suppose no pegs). In the example we now know there’s a red pin, and that it’s in the 3rd or 4th spot (as we got a white pin at Red Red Blue Blue). Finding it will be discussed in the next strategy (in one step: Red Green Green Green ). Result 3: more pegs (lets suppose 2 white pegs). Just as Result 2, we can try Blue Blue Blue Blue to know how many pins were blue (lets again assume zero). Now it’s only a matter of finding the pins. In the example, we already know the 3rd and 4th are red pins, as there are 2 red pins, and they are not in the first or second spot (as we have gotten 2 white pegs)

Red Green Green Green Yellow Red Yellow Yellow Pink Pink Red Pink Note: If you know the exact amount of reds, you don’t need to try the last location: if there’s one red pin, and it’s not in the first, second or third location, it has to be in the fourth). Result 1: If there are no white pegs, you’ll have at least one black peg. That peg indicates the red pin is on the correct location Result 2: If there’s one white peg, you know the red pin is on an incorrect place, and that the alternate color isn’t in the code Result 3: If there’s a second white peg, you know the second color should be on the location where the red pin is. Result 4: If there are one or more black pegs, that indicates that the second color is present. It also gives you the number of pins of that color, and you know it’s not on the location where red is (as that would give a white peg), or, obviously, on the location where red ends up being

Green Yellow Yellow Yellow Result 1: no pegs; green and yellow are not in the code Result 2a: a white peg indicates green is in the code, but we don’t know the amount (it might be one, but also two or even three) Result 2b: the number of black pegs indicates the amount of yellow in the code (as noted in Strategy 2: knowing the exact amount can save you a step in finding the color)

Green Green Yellow Yellow Result 1: no pegs: green and yellow are not in the code Result 2a: a white peg indicates one green is in the code, while 2 pegs indicate there are green are in the code (since there are only 2 unknowns, it’s impossibly for there to be three greens) Result 2b: as with the previous strategy, the amount of black pegs indicates the amount of yellow in the code. (as noted in Strategy 2: knowing the exact amount can save you a step in finding the color)

(strategy 1) Blue Blue Red Red gives 2 white pegs. So we know there’s a red and/or blue present. We want to know which is blue and which is red, so we check: (strategy 1 bis) Blue Blue Blue Blue gives one black peg. This means, we know in the previous answer, there was one blue (and on the wrong spot - so will be 3rd or 4th), and thus also one red (and also on the wrong spot, so will be 1st or 2nd) (strategy 2 (find blue)) Green Green Blue Green gives a white and a black pegs. We tested one of the locations of blue, and as there’s a white peg, we know it’s not the 3rd peg. As we know it was either the 3rd or 4th peg, we know the 4th peg is blue. The black peg also indicates there’s a green peg, but it’s not the 3rd spot (as it’s a black peg, not a white peg). (strategy 2 (find red)) Red Yellow Yellow Yellow gives a single white peg, so while we know, red is in the first or second spot, we now know it’s not in the first spot. So it’s in the second location. We also know there’s no yellow color The next color we had information over was green - but as we know it’s not the third spot, and the second and fourth spot is filled with blue & red, we know it’s on the first spot. (strategy 4) Orange Orange Pink Orange Gives a white peg. So, we know the only unknown spot - the 3rd spot - has an orange color (answer) Green Red Orange Blue