Mastermind

Table of Contents
  1. About the Project
  2. Screenshots
  3. Technologies Used
  4. Play the Game
  5. Next Steps
  6. Resources

About the Project

Mastermind is a code-breaking game traditionally played by two players, with one being the "codemaker" and the other the "codebreaker."

In this version of the game, the player plays as the codebreaker trying to guess a code that has been randomized by the program. The code consists of four colors selected from six possible colors, where duplicates are possible. The player has 12 turns to guess the code before they lose.

Once a player makes a guess, a miniature board ("miniboard") will display colors indicate how accurate their guess was. A green circle indicates a correct color in the correct position. A yellow circle indicates a correct color but in the incorrect position. A red circle indicates no match. The miniboard does not necessarily confirm the order of the guess.

Screenshots

Screenshot of the game at start, added in the Markdown.

Screenshot of the game after a victory with the code shown, added in Markdown.

Technologies Used

  • HTML
  • CSS
  • JavaScript

Play the Game

You can play the game by clicking here!

Feel free to submit a pull request if you would like to suggest any changes.

Next Steps

  • Add a color-blind option
  • Hide the game instructions in a modal that opens upon click
  • Add an animated background and/or other style enhancements; refactor for accessibility and responsiveness
  • Allow the player to submit a code to be cracked with an algorithm

Resources