*PROJECT :- *
** Higher–Lower Game**
Import Required Modules
Import art assets (logo, vs) from art file
Import data list from game_data file
Import random module
Define Function: choices()
Randomly select and return one entry (dictionary) from data list.
Define Function: main()
Set initial score = 0
Set game_active = True
Select first random choice and assign to choice_1
Game Start – Repeat While game_active is True
Display the game logo
Select a new random data entry and assign to choice_2
If score > 0:
Display “Your Current Score: {score}”
Display choice_1 details (name, description, country)
Display “vs” symbol
Display choice_2 details (name, description, country)
Ask user: "Who has more followers? Type 'A' or 'B'"
Convert user input to uppercase
Determine actual winner:
If choice_1 follower_count > choice_2 follower_count → winner = 'A'
Else if choice_1 follower_count < choice_2 follower_count → winner = 'B'
Else → winner = 'Draw'
Compare User Guess
If winner == user_choice:
Update score = score + 1
Set choice_1 = choice_2 (carry forward next comparison)
Else:
Display “Sorry, that’s wrong. Final score: {score}”
Set game_active = False
End of Game
Program stops when user gives an incorrect answer.
Game Logic Notes
Each round, two random people/accounts are compared based on their follower count.
The user tries to guess who has more followers.
If the guess is correct, score increases by 1, and the next round compares the previous winner with a new random choice.
The game continues until the user makes a wrong choice.
Top comments (0)