#------------------------------------------------- #Project: guess the number #Standard: 91883 (AS1.7) v.1 #School: Tauranga Boys' College #Author: Sean Macilwee #Date: THE DATE YOU COMPLETED THE CODE #Python: 3.5 #------------------------------------------------- import random import sys maxguesses = 10 maxrounds = 3 number = random.randint(1, 1000) wins = 0 losses = 0 maxwins = 2 maxlosses = 2 replay = " " startgame = "y" print ("\033c") blue = '\33[36m' #player name name = input(blue + "enter your name here:") print("Hello {} it is now time to guess a number".format(name)) while maxrounds <= 3: print("\033c") print(blue + "you have started a round") number = random.randint(1, 1000) maxguesses = 0 if wins == 2: print("you have won congratulations") if losses == 2: print("unlucky you have lost") while maxguesses < 10: s = int(input( "\nHi {} please enter a number between 1, 1000:".format(name))) if s > number: print("the number you are looking for is lower") if s < number: print("the number you are looking for is higher") if s == number: print("you have found the number nice job!") wins += 1 break maxguesses += 1 maxrounds += 1