This is a course web page of David Casperson |
|
There is a reasonable Wikepedia article about Mastermind here. The game is currently sold by Pressman Toys who give scoring instructions here.
The classic game is played with code pegs of six different colours, and four holes for 1296 different possible codes, but clearly other parameters are possible. Note that, unlike “Bulls and Cows”, Mastermind allows repetitions of coloured pegs, both in the guesses and in the answers.
For the purposes of programming assignments, assume the six-colour, four-hole version of the game unless otherwise instructed.
For greater precision as to what the scoring algorithm is, note that the number of black (or red in Pressman’s version) pegs scored is the number of exactly matching pegs; and that the number of black plus white pegs scored equals the cardinality of the intersection of the multisets.
fall-2024