I hope you enjoy this game as much as I do. I also hope the program works correctly. To find it, go to http://www.arps.org/users/hs/kochn/qr/MastermindApplet.htm.
To play Mastermind, you try to guess what colors are in a secret code picked by your opponent (in this case the computer). The code can use repeated colors. For example it might be this set of colors:
| Blue | Green | White | Green | Red |
Suppose that is the correct code and you guess this set of colors:
| Red | Orange | Black | Green | Orange |
The computer gives you a score for your guess. In this example, you had two correct colors, red and green. Your green guess was also in the correct position, but your red guess was not. So, the score you get for this guess would be: one black dot, one white dot. The black dot represents the correct color in the correct position, while the white dot represents the correct color in the wrong position. You have no way of knowing, however, which colors earned you that score. All you know is that you have two correct colors somewhere in your guess. The position of the scoring dots has no connection to positions in the code.
At the bottom of the applet screen, you will see five empty boxes where you will construct your guess. Click on a color button and it will fill in the first square with that color. You can skip around, by highlighting certain squares in the guess box. Also, if you right-click on a square, you can remove a color and change it to something else. When you have all five colors the way that you want them, click "Submit Guess."
At the top of the applet, you will see one label that tells you how many codes are possible at that point, given the way the scoring has gone. Another label tells you if the guess you made was one of those possible codes. You'll notice that even though the original number of possibilities is quite large (32,768), they drop off very quickly. If you construct your guesses carefully, you will narrow it down to only one possibility within seven guesses.
It can be difficult to construct a good guess. You have to use multi-step deductive reasoning ("if this, then that"). I made a sheet to help you with your deductions, and we will practice using it as a class. To use the sheet, first state a hypothesis. For example, perhaps you think red is one of the correct colors in your code. So you say: if red is correct what else has to be true? Then you follow all of the consequences of red being correct. It might mean that green can't possibly be correct, so you cross out green on the handy list provided for you. It might also mean that blue is definitely right, so you circle blue on your list. Go as far as you can with the assumption that red is correct. Then advance another hypothesis and check the consequences of that.
| QR Home Page | Glossary | Previous Worksheet | Next Worksheet |