Mastermind.mp4
Mastermind Java Game is an engaging and interactive console-based application inspired by the classic Mastermind board game. It challenges players to test their logic and deduction skills by guessing a secret code within a limited number of attempts. In our latest update, we've introduced three new algorithms: random, minimax, and DFS (Depth-First Search) to enhance the gameplay experience and offer varied strategic approaches for players.
Bucknell University
Lewisburg, PA
Instructor: Professor Stough
Semester: 2023FW
Class: CSCI 205 - Software Engineering & Design
-
Nolan Lwin - Class of 2026, Computer Science
-
Chang Min Bark - Class of 2026, Computer Science and Engineering
- Code Generation: The game generates a secret code made up of a sequence of four number pegs for the player to guess.
- Player Input: Players enter their guesses through the console, trying to crack the secret code within a specified number of attempts.
- Feedback System: After each guess, the game provides feedback to the player, indicating how accurate their guess was. Feedback typically consists of clues, indicating correct pegs in the correct position (represented as *) and correct pegs in the wrong position (represented as +).
- Limited Attempts: Players have a limited number of attempts (up to 12 attempts) to guess the correct code, adding an element of strategy and urgency to the gameplay.
- Random Algorithm: The game generates a random code for the player to guess.
- Minimax Algorithm: The game generates a code based on the minimax algorithm for the player to guess.
- DFS Algorithm: The game generates a code based on the DFS algorithm for the player to guess.
- Java 8 or later
-
Clone the Repository
git clone https://github.com/i-am-nolan25/Mastermind.git cd hw01
-
Compile and Run Open the project in your preferred IDE and navigate to the following path to run the game.
./src/main/java/hw01/game/Main.java
After launching the game, follow these steps:
-
Choose how you want to play the Mastermind game through 4 options: User, Random, Minimax, and DFS.
-
If user, input your guesses based on the feedback provided by the game.
-
Try to guess the correct sequence within the allotted 12 attempts.
-
Enjoy and challenge your logic and deduction skills!
-
If one of the algorithms, enter the number of games you want to simulate.
-
See the statistics of the algorithm such as the shortest and longest guess for the Mastermind game within the number of games you simulate.
-
Enjoy and test how efficient each algorithm is.
Java Runtime Environment (JRE)
Contributions to the Mastermind Java Game are welcome. Please follow these steps to contribute:
- Fork the repository.
- Create a new branch (git checkout -b feature-yourfeature).
- Make your changes and commit (git commit -am 'Add some feature').
- Push to the branch (git push origin feature-yourfeature).
- Create a new Pull Request.
This project is licensed under the MIT License.
Please create a new issue.
For any inquiries, feedback, or collaboration opportunities, please feel free to reach out to me through my email or LinkedIn.