""" ------------------------------------------------- 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") guesses -=1 print("guesses left:", guesses,) elif player_input > computer_number: print("ai number is lower") guesses -= 1 print("guesses left:", guesses) elif player_input == computer_number: print("congradulation you guessed the number and won the round") player_score -= 1 round_num -=1 print("player_score:", player_score) if guesses == 0: print("you ran out of gueses so the computer won the round") computer_score = computer_score + 1 round_num -=1 print("computer score: ", computer_score,"\npossible rounds left:", round) if round == 1 and player_score == 2: print("congratulations you won the guessing game") if round == 1 and computer_score == 2: print("you have lost and the computer has won the guessing game")