4th November 2004
Mastermind is a game of logical deduction, based on the classic 70s board game. The computer thinks of a four digit number and you have to work out what it is.
This game works in all browsers, including screenreaders and text-only browsers:
How to play
Start by making a guess. Each of the digits in the number you guess will be marked BLACK or WHITE. BLACK means the right digit in the right place; WHITE means the right digit but in the wrong place.
So for example: if the number was "1 4 2 5" and you guessed "2 4 3 3", you would score a single black and a single white - a black for the "4" in the right place, and a white for the "2" in the wrong place. When you get it exactly right you'll score four blacks, and the game is over.
The overall objective is to get it in the fewest attempts.
Get the script
Download the zipfile [14K] and unzip it into your site directory - the game is self-contained
mastermind folder. You can customise the appearance of the game using the
mastermind.css style sheet in the
The game requires PHP 4 with session support.