This is a web-based implementation of the classic Mastermind board game, created as a personal project before starting university. The game challenges players to guess a hidden code by making a series of guesses and receiving feedback on the correctness of their guesses.
- The game generates a secret code consisting of a sequence of colored pegs.
- The player tries to guess the code by placing colored pegs on the board.
- After each guess, the game provides feedback by indicating the number of pegs that are the correct color and in the correct position (black key pegs) and the number of pegs that are the correct color but in the wrong position (white key pegs).
- The player continues making guesses until they correctly guess the code or run out of attempts.
- HTML
- CSS
- JavaScript
- Interactive game board with drag and drop functionality for placing pegs.
- Randomly generated secret code for each game session.
- Feedback system providing hints based on the player's guesses.
- Timer to track the duration of each game.
- Responsive design that adapts to different screen sizes.
- Open the
index.htmlfile in a web browser. - The game will generate a secret code.
- Drag and drop the colored pegs onto the game board to make your guess.
- Click the "Check" button to receive feedback on your guess.
- Continue making guesses until you crack the code or run out of attempts.
- The timer will track the duration of your game session.
This project represents the original version of the Mastermind game, developed before starting university. It serves as a snapshot of my programming skills and understanding at that time. While the game is fully playable, there may be opportunities for improvement and optimization.
I plan to make further enhancements and refactor the codebase based on the knowledge and skills I have acquired since then on the main branch. The version that i wrote before university is available at the before-university branch.
This project is licensed under the Apache License 2.0.
If you use, modify, or distribute this code, please provide attribution to the original author as follows:
- Include a copy of the license
- Mention the project name and the author's name
- Provide a link to the original repository or the author's GitHub profile
For example:
This project is based on the [Mastermind Game](https://github.com/YuenSzeHong/mastermind-game) by [Yuen Sze Hong](https://github.com/YuenSzeHong/), licensed under the Apache License 2.0.
- The Mastermind game concept and rules are based on the original board game created by Mordecai Meirowitz.
- The project was inspired by various online tutorials and resources on web development and game programming.
Feel free to explore the code, provide feedback, or contribute to the project. Enjoy playing Mastermind!