What is MMS?
- MMS is a JAVA applet that will solve a Mastermind code if given correct
input about it's guesses.
How to play.
- First select your secret code from the color peg box. To do this
click on the color you want and then click on the location you want it.
If you want to remove a peg from your code, just click on it. When you are
happy with it click the "Ready" button.
- Now the computer will start guessing, after each guess it will
wait for your input about the guess quality. Place the appropriate
black and white pegs on the board and then click OK
- If your input is incorrect
the computer will not be able to solve your code! The computer
will detect such a situation immediately or after a few more guesses.
After such a situation is detected it will quit. If this occurs start over.
- If you would like to play a new game before the end of the current one,
click on the "Quit" button.
How MMS works
The Mastermind solver, MMS, uses a very simple algorithm. All the computer does is make
up random codes, check that these random codes fit with previous codes and the
information given about them, and if so submit the new guess. If the random code does not
fit with previous information, a new one is generated.
Using this algorithm, the computer solves the code in an average 4.6 tries. The maximum number of tries that it
has ever taken is 8, this occurs about 0.05% of the time.
- In runing the algorithm automatically (by letting the
computer make the codes and play itself) the my computer solves 10000 codes
in 15 minutes. I used the JAVA JIT (Just In Time) compiler on a Pentium 100 notebook computer with 24 megs of RAM.
- If you would like to play with a numerical Mastermind (much faster) solver click the
"Ner>y MMS" button on the applet above
Lately I have been working on optimizing the algorithm. I am studing the effects of having the computer select the guess that spreads out the possible answers best. The present results seem to reduce the average to 4.37 and the maximum number of guesses to 6. This is quite close to the optimum found so far: 4.34.
For questions or comments please write to
This page has been visited
times since July 23, 1997.