Mastermind

The following applet plays Mastermind. Given correct user scoring, it should converge on the correct solution within six guesses.

To play:

Select a 4-digit string consisting of the colors red (R), orange (O), green (G), blue (B), purple (P), and black (A). Sample strings are: RRRG, ROGB, AAGB, etc.

The computer will guess your string, and you will score the accuracy of the computer's guesses. For every character of the guess string that is the same digit and the same location as your string, give the computer one black peg. For every character of the guess string that matches one of your characters but is in a different location, give the computer a white peg.

Examples:

Your string: RRGG
The computer's guess: RGBB
The computer gets one black peg (for the R in the first position: you also have an R in the first position), and one white peg (for the G in the second position: you have a G in the third position).

Your string: RGGO
The computer's guess: ROOO
The computer gets two black pegs and no white pegs.

Your string: BGOR
The computer's guess: ROGB
The computer gets four white pegs and no black pegs.

Your string: RRRR
The computer's guess: RRRR
The computer gets four black pegs.


Mastermind

You don't have a Java-compatibly browser. If you had, you would see a java applet here. Try again with Netscape 2.0+.

Jessica Shepherd (jshepher@cs.utah.edu)
April 23, 1997