Valid XHTML 1.0 Strict | Valid CSS

Mastermind

pegs
colors
turns



Please begin a game by setting your preferences and pressing the 'Start New Game' button.

The game has been initialized for a standard Mastermind game. If this is what you wish to play, then please press 'Start New Game'.

You can play with interactive help turned on by clicking the 'Instructions' button before you start a game.

How to play

The object of the game is to guess the solution code by submitting guesses to the code and asking for a result on those guesses.

  1. Select your settings
    • More colors and/or more pegs makes the game harder
    • Fewer turns makes the game harder
    • Duplicates make the game harder
  2. Press 'Start New Game'
  3. Select the color you wish to place
  4. Select the location you wish to place it in, if there is already a color there, it will be replaced.
  5. When all the colors for the current row have been placed, click on the result box (highlighted in red)
  6. The game will return a set of pegs (if any) in the response box:
    • A white pegs means you got one of the colors correct, but in the wrong position
    • A red peg means you got the color correct and in the correct position
    • The pegs are not cumulative. i.e. if you place a blue peg on the board and the solution contains two blue pegs, you will only get one peg in response. Similarly, if you place two green pegs, and there is only one green peg in the solution, you will again only get one peg in response.
  7. If you guess correctly, the game is over and you win
  8. If you run out of turns, and you have not guessed to code, you lose

About this script

This script was created to be portable, meaning it is contained all in one file, you may download this file and play at home, or copy to your website with no other files needed.

Because the images in this file are embedded as Base64 encoded strings and Internet Explorer does not support this method, the script will look different in Internet Explorer. It will still work, but it will not look as it does in other compliant browsers.