Amazing-Python-Scripts
..
/
Codebreaker Game with AI
README.md
Codebreaker Game with AI
Welcome to the Codebreaker Game with AI! This game allows you to challenge the computer's AI to crack a secret code that you create. You can also try to crack the AI's secret code.
How to Play
- Run the script using Python.
- The game will prompt you to input a secret code, which consists of a sequence of numbers between 1 and 6.
- The AI will then attempt to guess your secret code using logical deduction.
- The AI will provide feedback on each of its guesses.
- You will also have the chance to guess the AI's secret code by providing your own guesses and receiving feedback.
- The game ends when either you or the AI correctly guess the secret code or when the maximum number of attempts is reached.
Features
- Player Interaction: You can enter your secret code and guess the AI's code.
- AI Logic: The AI uses a brute-force algorithm to deduce the code.
- Valid Input Handling: The game validates input to ensure correct format and range.
- Limited Attempts: Both you and the AI have a limited number of attempts to crack the code.
- Outcome Display: The game displays the outcome when the code is cracked or the game ends.
Prerequisites
- Python
How to Run
- Open a terminal or command prompt.
- Navigate to the directory containing the script.
- Run the script using the following command:
python codebreaker_game.py
Customize
Feel free to modify the code and add your own features to enhance the game further!