From HaskellWiki
Jump to navigation Jump to search

Mastermind is a board game where player A create a code of a number of symbols (colors, digits, letters) and player B has to guess the code. Player A evaluates every guess of the code using black pegs, meaning "right symbol at right place", and white pegs, meaning "right symbol at wrong place". Player B has to reconstruct the code using only these evaluations.

It is a nice task to let the computer guess a code. Here are some solutions in Haskell:

There are also implementations focussing on the game player rather than a computer player:

See also