A classic game of logic. There are many variations, and even two different versions of the original game (original and Super Mastermind), but the essence of the game is this:

A codemaker makes a secret code which consists of a sequence (usually 4 or 5) entries; each entry is one of several possible choices (the original game used colored pegs). The codemaker may be a computer in some versions. A guesser tries to guess the code; after each guess, the codemaker tells how many entries the guesser got correct and in the right position, and how many more additional entries the guesser has right but in the wrong positions.

The object is for the guesser to guess the code in as few tries as possible; if played competitively, the codemaker and guesser switch roles and the player to guess the code in fewer chances wins.

It is permissible for the code to have repeated entries, although you may play with an agreement not to use such codes, for an easier game. The responses can be harder to interpret with fewer codes; a repeated entry only counts twice in the response if the guesser chose that entry twice as well.