BFOIT - Introduction to Computer Programming

Mastermind Applet

The object of Mastermind is to guess a secret code that the program has chosen.  The computer randomly picks four colors from a pallet of six.  In this version of Mastermind, all four colors are unique, i.e., duplicates are not allowed in the secret code.

Your browser does not support Java applets. Click here for more information. Mastermind Applet

To play the game, you select colors from the column of six choices, filling in the row of empty frames which makes up your current guess.  Unlike the secret code, your guess may contain duplicate color choices if this helps you solve the puzzle.

Clicking the left mouse button on a color, fills the current empty box.  If you change your mind, clicking on the "Clear Color" button, clears your previous choice.  When your guess is complete, clicking on the "Guess" button provides feedback on the guess.

If the guess is correct, "You Win" is displayed.  Otherwise, two hints are given as feedback:

  1. the number of correct choices in the guess (in black), and
  2. the number of choices that are a correct color, but are not in the proper position in the sequence (in grey).

If you didn't win, and there is still room on the display, another set of empty boxes are drawn for your next guess.

When you run out of room for another guess, "You Lose" is displayed.