BigMaster is better in principle but I was too lazy to give it a useful input routine. Works, though.

I have saved a few posts from usenet regarding mastermind and its variations. In short: optimal solutions are known. Also, here's analysis of Mastermind from a game-theoretic [average strategy] perspective.

I don't mean to suggest here that I've thought over the issue with any great detail. You can get some more information and suggestions for further reading by looking at some old USENET posts I saved, in particular an encoding of a simple automated solver. (This program does _not_ encode an optimal strategy.)

You can play mastermind across the net:

I received mail from a programmer who advertises "a free Mastermind game in which the computer can also guess your selection so that you can play against it and try to beat its average score over 10 or more games." See http://www.homestead.com/beat_computer_mastermind/mastermind.html

Other pages at my own web site you may find of interest:

- My home page is just a short introduction to the pages I maintain
- The parent page to this one is dedicated to other mathematical games and mathematical analyses of "regular" games.
- I keep a large set of pages which provide a thematic introduction to the subject areas of modern mathematics, complete with answers to thousands of more or less common questions.

This page is

http://www.math.niu.edu/~rusin/uses-math/games/mastermind/index.htmlLast modified 2000/06/09 by Dave Rusin, rusin@math.niu.edu