Implements the game known as Mastermind.