In this game, user has to guess a number between 0 to 100 which is randomly selected by computer in limited number of tries. User also gets hint after certain number of tries.
Enjoy the game…!!
In this game, user has to guess a number between 0 to 100 which is randomly selected by computer in limited number of tries. User also gets hint after certain number of tries.
Enjoy the game…!!
Overview
A number guessing game where the player has 5 initial attempts to guess a randomly chosen number (1-100), followed by a bonus 3 tries with a hint if they fail the first round.
Key Features
Input Validation: Checks that guesses are valid digits within the 0-100 range
Two-Round Gameplay:
Round 1: 5 attempts to guess the number
Round 2: 3 bonus attempts with an even/odd hint
Feedback System: Provides “Higher/Lower” hints after each wrong guess
Win Condition: Player succeeds if they guess correctly in either round
Code Structure
Initialization: Sets up flags (z, x, y) and generates random number
Round 1 Loop: Main guessing loop with 5-try limit
Hint System: Displays parity hint (even/odd) after Round 1 failure
Round 2 Loop: Bonus round with 3-try limit and carry-over hint
End Game: Reveals the correct number if player exhausts all attempts