Welcome to Mastermind CLI, a command-line version of the classic strategy game Mastermind. In this game, you can play as either a Code Breaker or a Code Maker, challenging yourself or letting the computer do the thinking!
You can play Mastermind CLI either on Replit or locally on your machine.
- Create an Account: Sign up on Replit to get started.
- Enter Name and Details: Fill in your information to personalize your experience.
- Click on Import: Import the project into your Replit account.
- Click on Run: Start the game and enjoy the challenge!
This is a one-time process. After you've played once, you can come back to your Replit account anytime and enjoy the challenge.
- Ruby: Ensure you have Ruby installed on your machine. You can download it from ruby-lang.org.
-
Clone the repository:
git clone https://github.com/Udbhav227/mastermind-cli.git
-
Navigate to the project directory:
cd mastermind-cli
-
Run the game
ruby main.rb
- Two Play Modes:
- Code Breaker: Crack the computer-generated code in 10 moves or less.
- Code Maker: Create your own 4-digit code and let the computer try to break it in 5 moves or fewer.
- ๐ค AI-Driven Guessing: The computer uses a sophisticated minimax algorithm inspired by Donald Knuth's method to efficiently guess the code.
- ๐ป Command-Line Interface: Simple and easy-to-use interface for an engaging experience.
- The computer generates a secret 4-digit code.
- You have 10 moves to guess the code.
- After each guess, you'll receive hints to help narrow down your options.
- You create a 4-digit code.
- The computer uses a minimax algorithm to break your code in 5 moves or less.
Contributions are welcome! If you have suggestions, bug reports, or improvements, please feel free to contribute. Hereโs how you can help:
- Fork the Repository: Create your own copy of the project by forking the repository.
- Create a Branch: Create a new branch for your changes.
- Make Changes: Implement your changes or additions.
- Submit a Pull Request: Push your changes and submit a pull request with a description of what youโve done.
If you encounter any issues or have questions, open an issue on the GitHub repository.
This project is licensed under the MIT License. See the LICENSE file for details.
- Donald Knuth: For his foundational work on algorithm analysis, which inspired the AI in this project. You can read his seminal paper on the Mastermind algorithm here.