Bucknell University
Lewisburg, PA
Instructor: Professor Stough
Semester: 2023FW
Chang Min Bark - Class of 2026, Computer Science and Engineering
Nolan Lwin - Class of 2026, Computer Science
Project Name: Mastermind
Project Description: 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.
-
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.
- Clone the repository to your local machine.
- Open the project in your IDE of choice.
- Run the
Main.java
file via this directory:./src/main/java/hw01/Main
. - Follow the instructions in the console to play the game.
- Enjoy!
- (Optional) To run the JUnit tests, navigate to the
./src/test/java/hw01
directory and runCodeBreaker.java
andCodeMaker.java
files.