""" ------------------------------------------------ Project: Take-Away Game Standard: 91883 (AS1.7) v.1 School: Tauranga Boys' College Author: Suvin Bandara Date: 7/3/25 Python: 3.5 ------------------------------------------------- """ import random import time name = " " guesses = 0 rounds = 1 playerscore = 0 computerscore = 0 num = 0 currentround = 1 round_won = False guess = 0 playagain = "y" print("Are you ready for...") time.sleep(2) print(""" ████████╗██╗░░██╗███████╗  ███╗░░██╗██╗░░░██╗███╗░░░███╗██████╗░███████╗██████╗░░█████╗░ ╚══██╔══╝██║░░██║██╔════╝  ████╗░██║██║░░░██║████╗░████║██╔══██╗██╔════╝██╔══██╗██╔══██╗ ░░░██║░░░███████║█████╗░░  ██╔██╗██║██║░░░██║██╔████╔██║██████╦╝█████╗░░██████╔╝╚═╝███╔╝ ░░░██║░░░██╔══██║██╔══╝░░  ██║╚████║██║░░░██║██║╚██╔╝██║██╔══██╗██╔══╝░░██╔══██╗░░░╚══╝░ ░░░██║░░░██║░░██║███████╗  ██║░╚███║╚██████╔╝██║░╚═╝░██║██████╦╝███████╗██║░░██║░░░██╗░░ ░░░╚═╝░░░╚═╝░░╚═╝╚══════╝  ╚═╝░░╚══╝░╚═════╝░╚═╝░░░░░╚═╝╚═════╝░╚══════╝╚═╝░░╚═╝░░░╚═╝░░ """) name = input ("Whats your name") print ("Hello", name) print ("welceome to CAN YOU GUESS THE NUMBER? where you have to guess a random number i am thinking of ") time.sleep(1) print ("you have 3 round have no more than 10 guesses in each round. If you guess the number between theses 3 rounds you win if you dont you simply lose") time.sleep(1) print (" ready? the number is between 1-1000 input ur first guess") print(f"Round {rounds}") print(f"{name}'s score: {playerscore}") print(f"Computer's score: {computerscore}") import random playagain = "y" while playagain.lower() == "y": computerscore = 0 playerscore = 0 rounds = 1 while rounds <= 3: num = random.randint(1, 1000) guesses = 0 round_won = False while guesses < 11 and not round_won: num1 = int(input("Guess: ")) while guess > 1000 or guess < 1: print("Invalid number! Please enter a number between 1 and 1000.") guess = int(input("Guess: ")) if num1 == num: round_won = True print("Congratulations! You guessed correctly!") elif num1 > num: print("The number is too high!") else: print(" The number is Too low!") guesses += 1 print() print(f"Your score is: {playerscore}") print(f"The computer scored: {computerscore}") if computerscore > playerscore: print("The computer won!!") elif playerscore > computerscore: print("You won, nice job!") if round_won: playerscore += 1 else: computerscore += 1 rounds += 1