Break the secret code!

 
 
 

About the game, and the code

This game is played like the classic logic game MasterMind. My version features the ability to change the size of the code (from 3 pegs up to 6 - why in the world would anyone want to go higher?), to change the number of colors available (from 3 up to 10), and to disallow repeated colors in the secret code. You can also choose whether you want the scoring pegs to be black-and-white (which I think is the classic version) or red-and-white.

You should also check out the nice piece-grabbing effect I have implemented. It's a variation on 'mouse-following' behavior, but turns on and off according to relevent events (like clicking on an unplayed peg). I also made it so you can put pegs in and take them back out while you are thinking, and shuffle them around and so forth, before committing to a guess. I hate it when these games restrict peg play to be left-to-right, or they score your guess the instant the last peg is played, without letting you review your guess.

This game is programmed in javascript.