Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

MASTERMIND(6)                        BSD                         MASTERMIND(6)



NAME
     mastermind - Mastermind guessing game

SYNOPSIS
     /usr/games/mastermind

DESCRIPTION
     This program plays the game of "mastermind". The playing field is a
     number of slots, in which a number of colored pegs can be placed. The
     object of the game is to guess what color peg is in each slot. You and
     the program take turns trying to guess each other's configuration.

     Before play begins, mastermind asks you whether you want instructions.
     Respond by typing a "y" for yes or an "n" for no. Following this, you
     have a chance to decide how many slots and how many colors you want to
     use. When you enter a guess, type the names of the colors, separated by
     spaces. When the program makes a guess, respond with two digits separated
     by spaces.

     A guess consists of a possible sequence of colored pegs. The guesser's
     opponent answers with two numbers: the number of pegs in the guess that
     exactly match the corresponding pegs in the configuration, and the number
     of pegs in the guess that match in color but not in position. For
     example, suppose you are playing with five slots, and the following
     situation occurs:
         my configuration:   red       red       yellow    blue      brown
         your guess:         blue      red       green     red       red
     The two numbers would then be 1 and 2. The 1 applies because both you and
     the program have a red peg in the second slot. In addition, your blue
     matches the program's blue, though the position is wrong, and one of your
     reds matches the program's red in the first slot. Only two of your reds
     match because the program only has two reds in its configuration.

     Any time it is your turn to enter a guess, you can ask the program what
     happened by typing "review" instead of your guess. You get one point for
     each guess that the program has to make, and it gets one point for each
     guess that you have to make.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026