General

This section contains the following topics.

Summary

Game play

Match rules

Entering the hidden solution colors

Information

Summary

Mastore Mind is a complete computer implementation of the traditional Master Mind(TM) game.

Options such as user/computer guess mode, total colors, selected colors, and duplicate colors can be changed to vary the play. For more details see options.

Game play

The game of Mastore Mind requires 2 players, the computer can act as either player 1 or player 2. Player 1 chooses a random pattern of colors selected from a larger number of available colors. This random pattern is referred to as the hidden solution colors and is not revealed to player 2. Player 2 tries to guess the hidden solution colors and after each guess player 1 responds by setting the number of full and partial matches.

•	Full match - A color from the guess forms part of the hidden solution and is in the correct position. A full match is indicated by a small black color [image].

•	Partial match - A color from the guess forms part of the hidden solution but is not in the correct position. A partial match is indicated by a small white color [image].

Based on the full and partial matches player 2 tries to make a better guess of the hidden solution colors. Player 2 is only allowed a certain number of guesses or tries in which to find the hidden solution colors.

If player 2 correctly guesses the hidden solution colors before running out of tries then player 2 wins the game. If player 2 runs out of tries then player 1 wins the game.

Match rules

For the definitions of full and partial matches see game play.

The following examples show how the full and partial matches work. In both cases the top row of colors represents the hidden solution colors and the bottom row the guess and resulting matches.

  In this example there is one full match ( blue color ) and one partial match ( green color ).

  In this example there are two full matches ( black and red colors ) and one partial match ( white color ). Only one of the red colors in the guess can match the single red in the hidden solution and a full match always takes precedence.

Note : The position of the matches has no relationship to the color guess positions, only the number of matches is significant.

The following rules should be observed when entering matches in computer guess mode.

•	A single partial match is not allowed if the rest are all full matches ie. . This is because a single color from the guess cannot be in the wrong position if the rest of the colors are all in the correct position.

•	If duplicate colors are not allowed and the number of selected colors is greater than the number of total colors divided by two then the sum of the full and partial matches must be greater than or equal to twice the number of selected colors minus the number of total colors. Example : if total colors is 6 and selected colors is 4, then 4 > ( 6 / 2 ), and so there must be at least ( 2 * 4 ) - 6 = 2 matches ( in any combination of full or partial ). In other words, if two people have to choose 4 colors from a total of 6 then they will have at least 2 colors that are the same between them.

•	If duplicate colors are allowed and the guess contains all the same color ie.  then the number of partial matches must be 0.

Entering the hidden solution colors

In computer guess mode if the computer is unable to make a guess the user will be prompted to enter the hidden solution colors into the hidden solution area.

After the user has entered the hidden solution colors and pressed the "OK" button the computer will check the previously entered full and partial matches.

If a match is wrong the match area for that try is highlighted and the actual matches, based on the hidden solution, are displayed above the entered matches. See below for an example.

Information

Mastore Mind was written by Norbert Mueller ( norbert@bcssc.neca.nec.com.au ) April 1997.

This application may be freely copied and distributed provided that it is not modified.

The GUI of Mastore Mind is based on Mastoid Mind. Mastoid Mind was written by Chris Stromberger of Megabyte Rodeo, Inc.


Window layout

The main window consists of the following areas.

Hidden solution area

Play area

Duplicate color indicator

Total color area

Match color area

START/OK button

Hidden solution area

  During play the hidden solution area is blanked.

  At the end of a game the hidden solution colors are displayed in this area.

  In computer guess mode the hidden solution area can become the active area when the user is requested to enter the hidden solution colors.

Play area

  Each horizontal row in the play area represents one try. The first try is at the bottom of the play area and the last try is at the top. The total number of tries depends upon the number of total colors, selected colors, and whether duplicate colors are allowed or not.

A horizontal row consists of a color guess area and a match area.

  The color guess area displays the current and any previous color guesses. In user guess mode the user is allowed to enter or modify colors in the active color guess area.

  The match area displays the current and any previous matches. In computer guess mode the user is allowed to enter or modify matches in the active match area.

During play the active area is indicated by a highlight border around either the color guess area or the match area.

  Active color guess area, ( user guess mode ).

  Active match area, ( computer guess mode ).

The following summarises the entry or modification of colors in the active area.

•	Drag and drop from the total color area/match color area to the active area.

•	Drag and drop from old position in the active area to new position in the active area.

•	Right mouse button click in the total color area/match color area will enter the color/match into the active area. The color/match will be entered into the first blank position in the active area. If there are no blanks in the active area then the next sequential position will be used.

•	Right mouse button click on color/match in the active area will blank the selected position.

Duplicate color indicator

Indicates whether duplicate colors are allowed/not allowed in the guess or the hidden solution colors.

  A red and a green circle indicates that duplicate colors are not allowed, all colors must be unique.

  Two red circles indicates that duplicate colors are allowed.

Total color area

  Displays the total available colors that can be used to make up the guess or the hidden solution colors.

The number of total colors shown can vary, see options - total colors.

During play, in user guess mode, the total color area can be used as the source for a drag and drop operation ( left button ) or as a selection ( right button ) for the color guess area. See play area for color entry details.

Match color area

  The match color area is only displayed in computer guess mode and shows the full ( black ) and partial ( white ) match colors.

During play the match color area can be used as the source for a drag and drop operation ( left button ) or as a selection ( right button ) for the match area. See play area for match entry details.

START/OK button

The START/OK button performs a dual function which depends upon the state of play.

  Before beginning a new game the button text displays "START". To begin a new game the user must press the "START" button. When the "START" button is pressed the hidden solution area is blanked, the play area is reset, and the button text now shows "OK" indicating play is in progress. Upon completion of the game the button text reverts back to "START".

  During play pressing the "OK" button indicates that the user has finished entering either the color guess, the full/partial matches, or the hidden solution colors into the active area and the computer is to process the user input.


Options

The following options can be changed.

User/computer guess mode

Total colors

Selected colors

Duplicate colors

The options dialog can only be accessed before beginning a new game or after completion of the current game, ie. when the START/OK button text shows "START".

When any option has been changed and the OK button is pressed the main window is redrawn to reflect the new option value(s).

User/computer guess mode

  When user guess mode is selected the computer will pick the hidden solution colors which the user must then guess. After the user enters the guess the computer will respond with the number of full and partial matches.

  When computer guess mode is selected the user will pick the hidden solution colors which the computer must then guess. After the computer displays the guess the user will respond with the number of full and partial matches.

Total colors

  Changes the total available colors that can be used to make up the guess or the hidden solution.

The number of total colors can vary between 4 and 10 inclusive. The total colors available are shown in the total color area.

Use the spin buttons to change the value of the total colors.

Selected colors

  Changes the number of selected colors that comprise the guess or the hidden solution.

The number of selected colors can vary between 2 and 5 inclusive and must be less than the number of total colors. The play area indicates the number of selected colors.

Use the spin buttons to change the value of the selected colors.

Duplicate colors

  When not checked then all the colors in the guess or the hidden solution must be unique.

  If checked allows the same color to be used more than once in the guess or the hidden solution.