Nav Bar Home Curriculum Ideas Postcards Research Tools Treasure Hunts Web Links Web Projects Web Picks About
 

Mastermind in JavaScript

Mastrmind is a game of deduction to break a code. Don Greenwell, a Professor of Mathematical Sciences and Foundation Professor at Eastern Kentucky University and Alex Bogomolny who holds a Ph.D. in Applied Mathematics from the Hebrew University of Jerusalem provide a detailed explanation of the game. Try your skill playing the computer.

The object of this game is to guess the sequence of four colored pegs the computer has selected at random from the circled colors in the right field.

You start filling the holes at the bottom row with pegs, and each time you have completed a guess (i.e. filled all four holes) the computer will respond by giving you one peg for each correct color - black if your guess was also in the right place, otherwise white. (But you will not be informed about which colors were correct. That part you will have to figure out for yourself.)

If you haven't managed to guess the sequence by your 8th guess, the computer will reveal it to you and the game ends.


First select which colors you want to play with. (The default set contains blue, green, red and yellow. That's moderately difficult. For obvious reasons you are not allowed to select fewer than two. :-) Clicking on a color in the field on the right will toggle the circle around it on/off, indicating whether it will be part of the set the computer draws from. Then press 'Start' to begin.

In case you wish to start over, just press 'End' to discontinue the game.

Disclaimer: the name "Mastermind", the toy and distinctive likenesses thereof are the properties of Hasbro Inc. This javascript is an unofficial, not-for-profit version and neither it nor this site is endorsed by Hasbro in any way.

 

 

Updated August 27, 2017
© 1996 - 2009 Linda C. Joseph
All Rights Reserved
All CyberBee Graphics are Trademarked

Graphics by
Darlene Vanasco/Creative Director
Erika Taguchi/Designer & Illustrator
Hosting Provided by Iwaynet