#---------------------------------------- #Project: guessing game #Standard: 91883 (AS1.7) v.1 #School: Tauranga Boys' College #Author: Cooper Willoughby #Date: THE DATE YOU COMPLETED THE CODE #Python: 3.5 #---------------------------------------- # Inport libraries import random import time # Guesses max_guesse = 10 reset_guesses = 0 #rounds rounds = 1 # Scores user_score = 0 com_score = 0 #numbers for what you have to guess or what you have guessed number = 0 player_number=0 #players name name=input("Hello player, what is your name: ") #intro print("Welcome to the guessing game",name) time.sleep(1) print("In this game you are trying to beat the bot") time.sleep(2) print("The bot get to chose the number and you got to try and guess what it is") time.sleep(2) print("you get 10 trys to guess the number and if you dont guess it the bot wins a point") time.sleep(2) print("It is best of 3 rounds and the bot gets to pick a number between 1 and 1000") time.sleep(2) print("do you have what it takes to beat the bot") time.sleep(3) #how many rounds while rounds < 4: if rounds == 4 : break number=random.randint(1,1000) print("You are in round",rounds) time.sleep(2) #how many gueses and the input of number while reset_guesses < max_guesse: player_number=int(input("guess a number:")) reset_guesses += 1 # if user_score == 2: print("Good job", name, "you have won") if player_number < number: print("Higher") if player_number == number: print("nice you got it", name) player_number +=1 rounds += 1 reset_guesses=0 print("You are now in round",rounds) elif player_number > number: print("Lower") else: print("sorry", name, "but you have no guess left bot wins", number) com_score += 1 rounds += 1 reset_guesses=0 if rounds == 3: break #if bot gets 2 points game ends if com_score == 2: print("The bot has won")