""" ------------------------------------------------- Project: Take-Away Game Standard: 91883 (AS1.7) v.1 School: Tauranga Boys' College Author: YOUR FULL NAME Date: THE DATE YOU COMPLETED THE CODE Python: 3.5 ------------------------------------------------- """ import random import time RESET_GUESSES = 10 ROUNDS = 3 player_score = 0 computer_score = 0 round_won = True round_num = 1 computer_number = 0 guesses = RESET_GUESSES print("Guesing game") playername = input("What is your name? ") print("Welcome, " + playername + ". This is the guessing game.") print("You will be guessing a number between 1 and 1000.") print("The game is a best of three, meaning 3 rounds if needed.") print("Each round you have 10 guesses.") print("round:", round,"\nUser score:", player_score,"\nComputer_score:", computer_score) while round_num <= ROUNDS and player_score < 2 and computer_score < 2: computer_number = random.randint(1, 1000) guesses = RESET_GUESSES while guesses > 0: player_input = int(input("pick a number between 1 and 1000? ")) if player_input < computer_number: print("ai number is higher") elif player_input > computer_number: print("ai number is lower") else: print("congradulation you guessed the number and won the round") player_score +=1 break guesses -= 1 print("guesses left:", guesses) if guesses == 0: print("you ran out of guesses, so the computer has won the round") computer_score += 1 print("player score:", player_score) print("Computer score:", computer_score) round_num += 1 print("\nRound:", round_num) if player_score > computer_score: print("Congratulations! You won the guessing game.") elif computer_score >! player_score: print("You have lost and the computer has won the guessing game.") else: print("The game ended in a tie.")