""" ------------------------------------------------- Project: Guess the Number Standard: 91883 (AS1.7) v.1 School: Tauranga Boys' College Author: Gareth Richard Willats Date: 7/03/2025 Python: 3.5 ------------------------------------------------- """ #Imports import random import time #Define def s2(): time.sleep(2) def s1(): time.sleep(1) #____________________________________________________________________ #Variables name = "" number = random.randint(1,1000) guess = 0 rounds = 0 playagain = "" round_win = 0 round_loss = 0 #____________________________________________________________________ #StartingStrings str(print("What is your name?")) s1() name = input("Input: ") print("Why hello",name) s2() print("And welcome to..") s1() print(""" ░██████╗░██╗░░░██╗███████╗░██████╗░██████╗  ████████╗██╗░░██╗███████╗ ██╔════╝░██║░░░██║██╔════╝██╔════╝██╔════╝  ╚══██╔══╝██║░░██║██╔════╝ ██║░░██╗░██║░░░██║█████╗░░╚█████╗░╚█████╗░  ░░░██║░░░███████║█████╗░░ ██║░░╚██╗██║░░░██║██╔══╝░░░╚═══██╗░╚═══██╗  ░░░██║░░░██╔══██║██╔══╝░░ ╚██████╔╝╚██████╔╝███████╗██████╔╝██████╔╝  ░░░██║░░░██║░░██║███████╗ ░╚═════╝░░╚═════╝░╚══════╝╚═════╝░╚═════╝░  ░░░╚═╝░░░╚═╝░░╚═╝╚══════╝ ███╗░░██╗██╗░░░██╗███╗░░░███╗██████╗░███████╗██████╗░██╗ ████╗░██║██║░░░██║████╗░████║██╔══██╗██╔════╝██╔══██╗██║ ██╔██╗██║██║░░░██║██╔████╔██║██████╦╝█████╗░░██████╔╝██║ ██║╚████║██║░░░██║██║╚██╔╝██║██╔══██╗██╔══╝░░██╔══██╗╚═╝ ██║░╚███║╚██████╔╝██║░╚═╝░██║██████╦╝███████╗██║░░██║██╗ ╚═╝░░╚══╝░╚═════╝░╚═╝░░░░░╚═╝╚═════╝░╚══════╝╚═╝░░╚═╝╚═╝ """) #____________________________________________________________________ s2() print("Give me a number between 1 and 1000,") s2() print("And I will tell you if you are higher or lower") s1() guess = input("Input: ") while int(guess) > 1001 or int(guess) < 0: print("Please choose a number between 1 or 1000!") s1() guess = input("Input: ") s1() while int(rounds) < 11 and int(guess) < 1001 and int(guess) > 0: if int(guess) < int(number): s1() print("Guess higher!") s1() rounds = rounds + 1 print("This was round", rounds) s2() print("Give me another number between 1 and 1000,") s1() guess = input("Input: ") if int(guess) > int(number): s1() print("Guess lower!") s1() rounds = rounds + 1 print("This was round", rounds) s2() print("Give me another number between 1 and 1000,") s1() guess = input("Input: ") if int(rounds) == 10: print("This is your last try.") s1() guess = input("Input: ") if int(guess) != int(number): print("You lost!") s1() int(round_loss) + 1 playagain = input("Wold you like to play again?") if int(guess) == int(number): print("You made it on the last go!") s1() int(round_win) + 1 print("Wold you like to play again?") s1() playagain = input("Input: ") if playagain == "Y": print("The score is now",round_loss,"to",roundwin) int(games) + 1 s1() print("You have played", rounds, "rounds.") s1() print("Give me another number between 1 and 1000,") s1() guess = 1 guess = input("Input: ") if int(guess) == int(number): print("You guessed it, it was",number,"""!""") int(round_win) + 1 s1() print("You have won", round_win,""" Rounds.""") print("You have lost", round_loss,""" Rounds.""") s1() print("Wold you like to play again?") s1() playagain = input("Input: ")