Code Breaker Collaboration At Open School Games

Numbers

Letters


This is the collaboration page for Code Breaker. The entirety of Open School Games is a work in progress, but to keep things as simple as possible for those who just want to play the games we use collaboration pages to suggest and make improvements. We also use collaboration pages to help learn the art of web design and computer programming.

Current game description

The game is played by guessing what four digits are behind the question marks. Enter a guess and click the check button. The game will evaluate your guess and respond by placing an open circle for each guess that is a correct digit that is out of place and a solid circle for each correct digit that is also in the correct place.

For example if the digits 1, 2, 3, 4 are behind the question marks and I guess 6, 4, 3, 5 the game will give me one open circle and one solid circle. The 4 is a correct digit, but not in the correct place. The 3 is a correct digit that is also in the correct place. From this information I can place another guess by changing one or more of my guesses and clicking check again. By reasoning and elimination try to guess the correct digits in as few guesses as possible.

See Mastermind board game for more information.

A code rewrite is needed

The current JavaScript was written using several poor programming practices. For example the global name space is used heavily and there is little separation between logic and user interface. I propose we use this code as an example to learn how to scope name spaces and separate logic from UI. This also seems like a good time to begin to write automated tests to verify our work. I propose we try Jasmine as a testing framework.