Welcome to Pliable Products

Professional Software Consulting

since 1989

Home Table of Contents

Mastermind Game

Topo Map Imaging

 

Home


Note: a Java enabled browser is required to view the sample.

It will take a few seconds to set up the board. The game is best played at a display resolution greater than 800x600.

Instructions: The program has picked a 5-color code. Your job is to break the code. Click on the colored pegs until your guess is what you want. Each time you click the "Guess" button, your entry is evaluated and the program tells you how many pegs you have correct (black pegs) and how many are in the wrong place (white pegs). The black and white pegs are placed left to right, their positions bear no relation to the positions of the colored pegs. Use the information learned from the responses to your previous guesses to crack the code. You only get twelve tries, so make each one count. Try playing a few times before reading the Strategy Hints.

A Java enabled browser is required to play the Mastermind game

Colored Pegs: mmlgred.gif (187 bytes) mmlgltgreen.gif (187 bytes) mmlgmaroon.gif (187 bytes) mmlgcyan.gif (187 bytes) mmlgyellow.gif (187 bytes) mmlgbrown.gif (187 bytes) mmlgdkgreen.gif (187 bytes) mmlgblue.gif (187 bytes)
Advanced Pegs: mmlgred.gif (187 bytes) mmlgltgreen.gif (187 bytes) mmlgmaroon.gif (187 bytes) mmlgorange.bmp (2038 bytes)
mmsmblack.gif (158 bytes) A peg is the right color in the right place (your goal is to get five of these)
mmsmwhite.gif (166 bytes) A peg is the right color, but in the wrong place

 

1 try Lucky
2-3 tries Brilliant
4-6 tries Genius
7-8 tries Excellent
9-10 tries Great
11-12 tries Needs work

 

 

                        Strategy Hints

Mastermind is a game of logic. Correctly solving the puzzle in as few guesses as possible involves methodically reviewing your previous guesses.

The best plan of action is to make assumptions at the same time that you are trying to gain new information.

Let's go over an example:

Hint Board Guess 1: Pick 3 of one color and 2 of another.

Guess 2: Assume the red peg was right, pick two more colors (maroon and cyan).

Guess 3: Assume the red peg and cyan pegs need to be moved and pick 3 of another color (yellow).

Guess 4: The red and cyan assumption is probably right along with one of the yellows. Pick another color (brown) too.

Guess 5: It looks like a yellow and brown peg need to be switched. Pick another color (green) too.

Guess 6: Green is not in the code and yellow needs to be moved. Add a blue. We can be pretty certain that we're right before clicking the button.

Your assumptions will not always be correct, of course. If we were wrong about the red peg in the first guess, we might not have known it until the 3rd or 4th guess. That doesn't mean it will take any longer to solve the code. The object is to learn something from each guess. If, for example, our first guess earned no black or white response pegs at all. That doesn't mean it was a bad guess. Quite the contrary, we learned that none of those colors are in the code, thus drastically reducing the number of possible combinations.

If you are certain a peg is in the code, but you're not certain of its location, it is always best to move it on each turn (look at the pattern that the yellow peg makes in the example). That way, you can usually make a better guess later on as to where it actually belongs without wasting guesses.

There are 5 slots, each of which can contain one of 8 colored pegs (advanced: 12). So the number of possible combinations of pegs is  85  or 32,768 (advanced: 125  or 248,832). If you come to a point where you know all of the colors in the code, but they're all in the wrong place (5 white response pegs) you will have reduced the number of combinations to 5!-1 or 119*. Careful review of your previous guesses, however, will most likely make your next "guess" a virtual certainty.

 

* We've subtracted 1 from 5 factorial because one guess has already been made, and is not likely to be repeated.

Accompanying music (if MIDI supported) composed by B. Foley.

 

Home ]

Send mail to webmaster@pliableproducts.com with questions or comments about this web site.
Copyright © 2000-08 Pliable Products
Last modified: April 2, 2003