CSE 1310 - Independent Project Ideas

Master Mind

Master Mind is a board game for two players. A description of the game can be found on this Wikipedia article.

In the original version of the game:

  1. Player 1 picks a secret pattern of four colored pegs. The pattern is a sequence, the order of the pegs matters. Multiple pegs can have the same color. There are six possible colors.
  2. Player 2 provides a guess for the secret pattern.
  3. Player 1 provides feedback, that gives information to Player 2 about the correct pattern. The feedback consists of black pegs and white pegs, as follows:
  4. If the guess was correct (indicated by four black pegs), then the game is over. The goal of Player 2 is to make a correct guess using as few guesses as possible.
  5. If the guess was incorrect, then Player 2 gets to continue guessing, and receiving feedback for each guess, until Player 2 finds the correct pattern (or, until a certain limit of guesses, like 10 guesses, has been reached).
More details on the game can be found on the Wikipedia article. You can play the game on the web on the Archimedes Lab page.

Your task is to implement a program that can play Master Mind with a human. You should start with a program that can do the following:

Most people who have tried this project have had trouble in producing the correct feedback, and particularly in making sure that each digit (in the guess or in the correct pattern) generates one and only one character on the feedback string. Getting the number of x's right seems to be the most error-prone task.

The second stage of this project would be to extend your program, so that:

This is a more creative task. You need to come up with a strategy that helps the computer use the provided feedback, so as to find the correct pattern in ten or fewer guesses (or at least in a smarter way than by just making an uninformed random guess each time). If you search on the web, you will find algorithms that guarantee finding the correct pattern in at most five guesses. Still, I would suggest trying to come up with your own strategies and seeing how well they work.

A possible third stage of the project would be to convert it from text-based to a graphical user interface (GUI). See the discussion on graphical interfaces on this website.