by Erica Schulman
Copyright © 1997. All rights reserved.
NOTE: This game is written with the 1.0 JDK for the widest possible browser compatibility. A 1.1 version is under construction.
Although this game has existed for a long time in a pencil and paper version, it became famous as a board game issued under the name Mastermind. One player (in this case the computer) chooses four marbles of various colors. Your goal is to determine which marbles the computer has selected.
Each column represents a guess. After selecting a marble from the bottom, begin with the column on the left. When a column is filled it is automatically scored. The top and bottom numbers represent:
number of marbles of the
right color, in the right place
number of marbles of the right color, in the wrong place
In this implementation, the computer will select at most two marbles of any given color. However, your guesses are not restricted.
Hopefully this interface is so intuitive you don't need more instructions (?), but more is explained below, along with links to the source. I have tested this applet with Netscape 3.x and 3.0, and checked it with Explorer 3.0 and Netscape 4.03. If there are any problems or bugs, please let me know.
This applet may take a while to load, depending on the network and your modem; even after the "Applet running" message there may be a wait.
More details on playing the game (a bit dull -- you might have more fun just experimenting): The GUI tries to help by highlighting things that you should click on. The first thing you will need to do is to select a marble from the ones shown at the bottom. After that, the board should react when you move the mouse over the left column. Click the mouse over an empty dimple to drop the marble there. You may drop the marble in more than one dimple, the marble will remain selected. If you click on another marble at the bottom, that becomes the active marble instead. If you click on a dimple that already has a marble in it, it will be removed.
Once a column is filled, it is automatically scored and marbles may no longer be removed. Also, you will need to select a marble from the bottom before beginning to fill the next column; they are automatically deselected.
Clicking on the ear toggles the sound on or off. If you get frustrated, "Solve" shows the answer. You must press "New Game" to play again.
You may also wish to look at the javadoc documentation.
back to home page