""" ------------------------------------------------- Project: Number Guess Standard: 91883 (AS1.7) v.1 School: Tauranga Boys' College Author: Rome Mackay Date: Start = 3/03/25 End = Python: 3.5 ------------------------------------------------- """ import random import time reset_guesses = 0 rounds = 3 user_score = 0 AI_score = 0 round_won = True round = 1 print ("--------------------------------------------") print ("Hello, welcome to Romes Number Guessing game") print ("Rules are simple, you have three chances to guess the number") print ("Starting round one") print ("Goodluck") name = input ("What is your name?") print ("Welcome, and always best of luck ", name) random_number = random.randint(1, 100) guess = int(input("Enter your guess: ")) if guess == random_number : print("Nice job!") else: print("Try again!") print ( "Lets try again") random_number = random.randint(1, 100) guess = int(input("Enter your guess: ")) if guess == random_number : print("Nice job!") else: print("Try again!") print ( "Lets try again") print("Your last chance") random_number = random.randint(1, 100) guess = int(input("Enter your guess: ")) if guess == random_number : print("Nice job!") else: print("Try again!") print ( "Lets try again") print(f"Sorry! You've run out of attempts. The correct number was {random_number}") if guess == random_number : print ("Nice job, lets play again") else: print ("Looks like you lost... do you wanna play again?") question = input ("So....? ").lower() if question == "no": print("Thanks for playing! Goodbye!") if question == "yes": round = 1 user_score = 0 AI_score = 0 print("Starting a new round...") else: print("Invalid input. Please type 'yes' or 'no'.") question = input("So....? ").lower() random_number = random.randint(1, 100) guess = int(input("Enter your guess: ")) if guess == random_number : print("Nice job!") else: print("Try again!") print ( "Lets try again") random_number = random.randint(1, 100) guess = int(input("Enter your guess: ")) if guess == random_number : print("Nice job!") else: print("Try again!") print ( "Lets try again") print("Your last chance") random_number = random.randint(1, 100) guess = int(input("Enter your guess: ")) if guess == random_number : print("Nice job!") else: print("Try again!") print ( "Lets try again") print(f"Sorry! You've run out of attempts. The correct number was {random_number}") if guess == random_number : print ("Nice job, lets play again") else: print ("Looks like you lost... do you wanna play again?") question = input ("So....? ").lower() if question == "no": print("Thanks for playing! Goodbye!") if question == "yes": round = 2 user_score = 0 AI_score = 0 print("Starting a new round...") else: print("Invalid input. Please type 'yes' or 'no'.") question = input("So....? ").lower() random_number = random.randint(1, 100) guess = int(input("Enter your guess: ")) if guess == random_number : print("Nice job!") else: print("Try again!") print ( "Lets try again") random_number = random.randint(1, 100) guess = int(input("Enter your guess: ")) if guess == random_number : print("Nice job!") else: print("Try again!") print ( "Lets try again") print("Your last chance") random_number = random.randint(1, 100) guess = int(input("Enter your guess: ")) if guess == random_number : print("Nice job!") else: print("Try again!") print ( "Lets try again") print(f"Sorry! You've run out of attempts. The correct number was {random_number}") if guess == random_number : print ("Nice job, lets play again") else: print ("Looks like you lost... do you wanna play again?") question = input ("So....? ").lower() if question == "no": print("Thanks for playing! Goodbye!") if question == "yes": round = 3 user_score = 0 AI_score = 0