Skip to content

TanayYadav22/Guess-Game-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Guess-Game-4-You

Coding Language:

image

Today, you will face off against a clever computer that’s hiding a number between 1 and 100. Your mission? To uncover its secret… before your chances run out!

The game begins with a choice. You decide the level of difficulty:

Easy Mode: 10 chances | Medium Mode: 5 chances | Hard Mode: only 3 chances.

Choose wisely… your fate depends on it

Behind this simple yet thrilling game lies some clever Python magic.

1️⃣ First, the game summons a secret number using random.randint(1, 100)—that’s the hidden treasure the player must find.

2️⃣ Next, the player chooses a difficulty. With Easy, you get 10 tries… with Hard, only 3. The code assigns these chances using simple if-elif logic.

3️⃣ Then comes the guessing loop. Each time the player enters a number, the program checks:

If it matches, the player wins | If it’s too high, the computer says “lower.” | If it’s too low, the computer says “higher.”

4️⃣ Finally, if all attempts run out, the computer reveals its secret number… and declares victory over the challenger.

Why I am making this?

beacuase: https://roadmap.sh/projects/number-guessing-game

that it, the only reason!

Final Thoughts!

So, dear adventurers, this isn’t just a guessing game… it’s a battle of wits between human and machine. Are you ready to play, to test your luck, and to outsmart the computer? Step forward, choose your level, and let the game begin!

& I hope this helps you in your career ahead!

image

/n https://roadmap.sh/projects/number-guessing-game/solutions?u=65bdf31d0c54812283845555 -> like this OR get 5 years of unemployment! Your Choice. Bye.

About

Repo for a basic program of the Python-based guess the number game!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages