""" ------------------------------------------------- Project: Take-Away Game Standard: 91883 (AS1.7) v.1 School: Tauranga Boys' College Author: James Lansdown Date: 7/03/25 Python: 3.5 ------------------------------------------------- """ import time #Makes the code have a couple seconds gaps on showing. import random #These two codes generate the random number. rounds = 3 round = 0 user_score = 0 AI_score = 0 round_won = True reset_guesses = 0 round_win = False play2 = "yes" guess2 = 0 #Variables #print("GUESS THE NUMBER") #time.sleep(2) #print("Guess a number between 1 and 1000.") #time.sleep(2) #print('You have 10 guesses per round and it is best out of three.') #time.sleep(2) #print("You get a point if you guess it in 10 but if you guess wrong the computer gets a point.") #time.sleep(2) play = input("Would you like to play? y or n? ") #Shows the player the title and the rules. if play == "y" : player_name = input("What is your name? ") play2 = input("Are you ready? yes or no ") while play2 == "yes" : number = random.randint(1,1000) round = round + 1 print("Round", round) print("I have a number. ") guess = int(input("{} guess a number ".format(player_name))) if guess < number : print("Higher") guess2 = guess2 + 1 print("Guess", guess2) guess = int(input("Try again: ")) elif guess > number : print("Lower") guess2 = guess2 + 1 print("Guess", guess2) guess = int(input("Try again: ")) else : print("Well done! ") user_score = user_score + 1 print("Your score is now ",user_score) play2 = input("Play again? yes or no ") guess2 = reset_guesses