This Python script is a simple guessing game called "Guess the Number" In this game, the user thinks of a number within a specified range, and the AI attempts to guess the number by making educated guesses based on the user's feedback.
- Roy BCS-01-0814/2022
- Alyakbar BCS-03-0003/2022
- Martin BCS-03-0002/2022
- Stephen BCS-03-4177/2022
- Omenke BSCIT-01-0413/2022
-
The game starts by displaying a welcome message, introducing the user to the game.
-
The user is prompted to think of a number between a lower and an upper bound (inclusive).
-
The AI will then make its first guess within the defined range.
-
The user provides feedback to the AI by responding with one of the following options:
'H': The guess is too high.
'L': The guess is too low.
'C': The AI guessed correctly.
-
Based on the user's response, the AI will adjust its guessing strategy to narrow down the range for the next guess and continue the guessing process.
-
The game will repeat the guessing and feedback process until the AI correctly guesses the user's number.
Requirements:
Python 3.x
Git
Open your terminal and type:
git clone https://github.com/alyakbar/AI-Project
Change directory to AI-Project where the script is:
cd AI-Project
Run the script using the command:
python guess_the_numbe.py.
-
AI Guessing: The AI is capable of making guesses to determine the number the user is thinking of.
-
Feedback Mechanism: The user can provide feedback to the AI's guess, helping it to adjust its subsequent guesses. Feedback options include:
'H': The guess is too high.
'L': The guess is too low.
'C': The AI guessed correctly.
-
User-Friendly Interface: The game presents a user-friendly interface with clear instructions and messages to guide the user through the gameplay.
-
Time Delay: The game uses time delays to enhance the user experience, providing brief pauses between messages to improve readability.
-
Dynamic Range Adjustment: The AI dynamically adjusts the guessing range based on the user's feedback to narrow down the possible numbers, improving its chances of guessing correctly.
-
Game Completion: The game concludes when the AI successfully guesses the user's number and displays the correct guess along with a victory message.
-
Error Handling: The game handles invalid user inputs during feedback, prompting the user to re-enter a valid option until the correct input is provided.
-
Difficulty Levels: Users are have the capability to choose the game mode on different levels i.e. Easy, Medium & Hard levels.
-
Guess Limit: We've also added a means in which users can define the number of Guesses to make the game a bit fun and challenging.
-
guess_count: Added a new variable to track the number of guesses the AI has made.
- Explain what you're working on by adding an issue before making any changes.