An Interactive Gaming Experience: From Simple Random Number Guessing To Advanced AI Solver Mode, Multi-Level Difficulty System, High Score Tracking, And Intelligent Hint Generation.
About • Tech Stack • Gallery • Evolution • How To Run • Warnings
This Repository Represents The Fourth Major Milestone In My Front-End Diploma (Programming Fundamentals Track).
It's More Than Just A Game, It's A Documentation Of My Journey In Game Development & Algorithm Design. The Project Chronicles The Evolution From Simple Random Number Generation Using Basic Input/Output To A Sophisticated Gaming System Powered By Object-Oriented Programming And Binary Search AI.
The Final Version Is An Intelligent Game That Features Two Distinct Modes: Player vs PC Where Users Try To Guess The Computer's Number Across Three Difficulty Levels, And AI Solver Mode Where An Artificial Intelligence Uses Binary Search Algorithm To Guess Your Number With Maximum Efficiency. The System Includes Persistent High Score Tracking, Smart Mathematical Hints, And A Professional Menu-Driven Interface.
• Python (3.10+): The Core Language Driving All Game Logic, Random Number Generation, And File Management Operations.
• Object-Oriented Programming: Utilizes Class-Based Architecture With Methods For Game Modes, Score Management, And Hint Generation.
• Random & Math Modules: Implements Random Number Generation For Game Mechanics And Mathematical Functions For Prime Number Detection.
• Binary Search Algorithm: Powers The AI Solver Mode With Optimal Guessing Strategy, Minimizing Attempts Through Smart Divide-And-Conquer Approach.
• File I/O Operations: Manages Persistent High Score Storage Using Text Files, Ensuring Records Survive Across Multiple Gaming Sessions.
• Miro: Used For Planning And Designing The Game Flow, Logic Flowcharts, And Algorithm Structure Before Writing Any Code.
| Basic Version | Advanced Version |
|---|---|
Planning (Logic)
|
Planning (Logic)
|
Execution (Main Result)
|
Execution (Main Result)
|
Watch The Game In Action: Playing Both Modes With Different Difficulty Levels And AI Solving Strategy.
Click To Watch Video ▷
| Feature | Basic Version | Advanced Version (AI-Ready) |
|---|---|---|
| Game Modes | Single Mode (Player Guesses) | Dual Mode (Player + AI Solver) |
| Difficulty Levels | Fixed Range (1-10) | 3 Levels (Easy/Medium/Hard) |
| Score System | Session-Based Tracking | Persistent High Score (File Storage) |
| Hint System | Basic Higher/Lower Hints | Mathematical Properties & Prime Detection |
| Code Structure | Procedural Programming | Object-Oriented (Class-Based) |
| AI Intelligence | No AI Features | Binary Search Algorithm |
• Dual Game Modes: Play As A Human Player Trying To Guess The Computer's Number, Or Watch The AI Solver Use Binary Search To Guess Your Number With Maximum Efficiency.
• Three Difficulty Levels: Choose Between Easy (1-10), Medium (1-100), Or Hard (1-1000) With Different Attempt Limits For Each Level.
• Persistent High Score System: The Game Automatically Tracks And Saves Your Best Performance To highscore.txt File, Challenging You To Beat Your Previous Records.
• Smart Mathematical Hints: Receive Intelligent Clues Based On Number Properties Including Divisibility Rules And Prime Number Detection When You Reach Mid-Game.
• Binary Search AI: The AI Solver Mode Demonstrates Computer Science Algorithms In Action, Using Divide-And-Conquer Strategy To Find Any Number With Optimal Speed.
• Professional Menu System: Navigate Through A Clean, Menu-Driven Interface With Screen Clearing, Player Name Tracking, And Real-Time Score Display.
git clone https://github.com/hexbido/Guessing-Number-Game.git
cd Guessing-Number-Gamecd Basic-Version
python Guessing_Game.pycd Advanced-Version
python Guessing_Game_AI.py
• Player Mode: Select Mode 1, Choose Your Difficulty Level, And Try To Guess The Computer's Secret Number Within The Allowed Attempts.
• AI Solver Mode: Select Mode 2, Think Of A Number, And Guide The AI By Responding With (H)igh, (L)ow, Or (C)orrect To Its Guesses.
• Using Hints: In Player Mode, You'll Receive Basic Direction Hints And A Smart Mathematical Hint At The Halfway Point.
• High Score: Your Best Performance Is Automatically Saved - Beat Your Record By Completing The Game In Fewer Attempts!
Please Review The Following Notes To Ensure Smooth Operation And Avoid Common Issues:
• Input Validation: The Game Expects Numeric Inputs For Guessing - Entering Text Or Special Characters Will Be Ignored Or Prompt Re-Entry.
• File Permissions: Ensure The Application Has Write Permissions In Its Directory To Create And Modify The highscore.txt File For Score Tracking.
• Screen Clearing: The Advanced Version Uses OS-Specific Commands To Clear The Screen - This Feature Works On Windows (cls) And Unix/Mac (clear) Systems.
• AI Solver Honesty: When Using AI Solver Mode, Provide Accurate Feedback (H/L/C) To The AI's Guesses - Incorrect Responses Will Cause The Algorithm To Fail.
• High Score Reset: To Reset Your High Score, Simply Delete The highscore.txt File - A New Record Will Be Created On The Next Game.
• Number Range: When Selecting Difficulty Levels, Pay Attention To The Range Limits - Guessing Outside The Valid Range Will Not Count As An Attempt.
• Mathematical Hints: The Smart Hint System Analyzes Number Properties - If Your Secret Number Has No Distinct Mathematical Properties, The Hint May Be Generic.
Made With
By B I D O













