MASTERMIND -- Analysis

Mastermind, the classic code-detecting game. I have written simple simulations of the game using BASIC.

  • master.bas - Direct simulation of the standard game
  • bigmaste.bas - Generalization allows more peg, colors, or turns

    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:

  • Marcel's WebMind
  • MasterWeb

    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

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

    This page is
    Last modified 2000/06/09 by Dave Rusin,