""" ------------------------------------------------- Project: Guessing Game Standard: 91883 (AS1.7) v.1 School: Tauranga Boys' College Author: Seth Morrison Date: THE DATE YOU COMPLETED THE CODE Python: 3.5 ------------------------------------------------- """ import random gamer = input("Hello what's your name? ") gamer_points = 0 bot_points = 0 max_rounds = 3 for stage in range(1, max_rounds + 1): print("\n=== Round "+ str(stage) +" ===") secret_num = random.randint(1, 1000) chances = 10 print( gamer +", guess a number (1-1000)!") won = False for turn in range(1, chances + 1): attempt = int(input("Try "+ str(turn) +"/"+ str(chances) +": ")) if attempt < secret_num: print("Nope, go HIGHER!") elif attempt > secret_num: print("Nope, go LOWER!") else: print( gamer +"! You got it! The number was "+ str(secret_num) +" in "+ str(turn) +" tries!") gamer_points += 1 won = True break if not won: print("Oof "+ gamer +", you're outta tries. The number was "+ str(secret_num) +".") bot_points += 1 print("SCOREBOARD -> "+ gamer +": "+ str(gamer_points) +", CPU: "+ str(bot_points)) if gamer_points == 2 or bot_points == 2: break print("\n=== FINAL SCORE ===") print(gamer +": "+ str(gamer_points) +", CPU: "+ str(bot_points)) if gamer_points > bot_points: print( gamer +", you're the champ!") else: print("GG "+ gamer +", but the CPU clapped you.")