""" ------------------------------------------------- Project: Take-Away Game Standard: 91883 (AS1.7) v.1 School: Tauranga Boys' College Author: Ethan Carleton Date: THE DATE YOU COMPLETED THE CODE Python: 3.5 ------------------------------------------------- """ print("--------------- GUESS THE NUMBER ------------------") name = input("What is your name?") print("Hello",name, "welcome to GUESS THE NUMBER! Your goal is to guess which number I am thinking of between 1 and 1000 !") print("If you guess the correct number you win a round, if you don't guess correctly I win a round, it is best of three so good luck!") #Import libraries import random #Guesses reset_guesses=0 #Rounds rounds=3 #User score user_score=0 #AI score AI_score=0 round = 1 #the amount of guesses guesses = 10 while rounds > 0: number_to_guess = random.randint(1,1000) guesses = reset_guesses print("Current scores", name, user_score, "computer", AI_score ) while True: guess = int(input("Enter your guess: ")) if guess < number_to_guess: print("Too low! Try again") guesses-=1 if guess == 0: print ("You loose I win this round") AI_score +1 break elif guess > number_to_guess: print("Too high! Try again,") guesses-=1 if guesses == 0: print ("You loose I win this round") AI_score +=1 break else: print("You guessed the number! You win this round.") user_score += 1 break if user_score==2: print("You won the game !") break if AI_score==2: print("I win the game !") break