Description
Description-Separate-1Invented in 1970 by the Israeli postmaster and telecommunications expert Mordecai Meirowitz, Mastermind is a well-known deductive game for two players: the code-maker, who chooses a secret code of four pegs of six possible repeatable colours, and the code-breaker, who tries to break the code by making guesses.
This example code implements a full version of the Mastermind game using an interactive table for playing and showing progress. Controls and decorations are cleverly handled with sub-VIs to provide matrix-style handling. Guesses can be submitted by dragging or double-clicking the pegs from a palette. Right-clicking can affix a hash character to the pegs of the palette to help with guessing. The computer can provide suggestions by selecting the corresponding item in the menu bar or by using the shortcut ctrl+h. The implemented strategy is based on the commutative property of the score (i.e., if you reverse the roles of the secret pattern and guess, the score remains the same). It is a simple but effective strategy that allows the solution to be found with no more than 6 and generally fewer moves.
Description-Separate-2How to Use
How-Separate-1Open the VI Mastermind.vi and run it. The tip strips will help you navigate through the features.
How-Separate-2