Mastermind

Image 1

Mastermind is a codebreaking game played by two players. The game starts with the first player, who we call "the codemaker", creates a hidden four digits (colors) code. Then the second player, who we call "the codebreaker", guess a code. The codemaker then evaluate the guess by providing the codebreaker with some black and white pins (plus and minus in the paper version). Based on the evaluation, the codebreaker guess another code and game continues untill either the codebreaker finds (or fails to find) the hidden code within a maximum tries.

Game History

"The modern game with pegs was invented in 1970 by Mordecai Meirowitz, an Israeli postmaster and telecommunications expert. It resembles an earlier pencil and paper game called Bulls and Cows that may date back a century or more." (Ref)

Game Rules

  1. If a digit of the guess code is in the hidden code and on the correct place, a black pin (plus) is put.
  2. If a digit of the guess code is in the hidden code but not on the correct place, a white pin (minus) is put.
  3. Every peg in the hidden code and the guess counts only once in the black and white pins.
  4. If a peg in the guess can be considered as both a black or a white pin, preference is black.

For example, let the hidden code and the guess be "1124" and "1343", respectively. Then the only '1' in the guess can result in a black pin (with the first '1' in the hidden code) or a white pin (with the second '1' in the hidden code). In such a situation, the codemaker must put a black pin not a white. In this example, the codemaker puts one black pin for '1' and one white pin for '4'.

QtMind

Image 2

QtMind is a free computer clone of the mastermind game written in C++ with the aid of the Qt framework. It is possible to enable/disable same color in codes. You can play codemaker or codebreaker.

Currently there are three solving algorithms in the codemaker game mode in QtMind: Donald Knuth's Worst Case (minimax), Most Parts, and Expected Size. The worst case algorithm finds the hidden code at most in five guesses in the classical game with six colors and four slots. The solving algorithm can be changed in the middle of a game.

The source code is compatible with any version of Qt greater than or equal to four, but to benefit game sound you should compile QtMind against Qt at least five.

The graphical characteristics of QtMind is almost identical to those of ColorCode, another high quality and powerfull clone of the mastermind game, though the coding is different. The result of rewritting is that QtMind is lighter, faster and more efficient than ColorCode. ColorCode only contains an incomplete version of the worst case solving algorithm.

QtMind can be translated to any language. If you are interested, help on how to translate QtMind to your language can be found on the tranlate page.

Screenshots

Translate QtMind To Your Language

If you are intersted to translate QtMind interface to your language here you can learn how. You need to have Qt Linguist installed on your system.

On the translation directory of the installed QtMind directory (or the source code) you can find the plain tranlation file with extention ts. For example the Czech translation file is qtmind_cs.ts. Open this file in Qt Linguist and translate all the fields.

Image 2

Then from File menu choose "Release" to get the qm file (in this case qtmind_fa.qm). To test your tranlation put this file in the translation directory so that QtMind be able to find it.

Please send your translation to omidnikta at gmail.

Singular-Plural Names

Image 1

Some languages have more than one form of plural names. QtMind can show these plurals correctly if you provide them. For strings that needs singular and plurals, you should provide singular and all plural forms so that QtMind use them correctly.