""" ------------------------------------------------- Project: Number knockout Standard: 91883 (AS1.7) v.1 School: Tauranga Boys' College Author: Hayden daniel kent. Date: THE DATE YOU COMPLETED THE CODE Python: 3.5 ------------------------------------------------- """ import time import random game = True mypoint = 0 aipoint = 0 guessing = True number1=random.randint(1,30) number2=random.randint(1,30) game2=True attempts = 1 Human = input("To begin i need you to type your name.") print("Welcome to number knockout.") time.sleep(2.5) print("The rules are simple.") time.sleep(1.5) print("You will have to guess a number 1-15.") time.sleep(2.5) print("If you guess wrong 5 times i will get a point, if you get it right within the 5 times you get a point.") time.sleep(4) print("During your turns if you get it wrong i will tell you higher or lower to indicate where the answer is.") time.sleep(4) print("Best of 3, wins.") time.sleep(2) print("Ok, lets begin.") totalattempts = 0 time.sleep(1.5) print("Time to guess the number.") while game == True: print("Attempt", attempts, "/ 5") time.sleep(1) Guess = int(input("take your guess..(1-30)")) if number1 == Guess : print("Correct.") time.sleep(1) mypoint += 1 totalattempts += attempts attempts = 1 game = False if number1 > Guess : print("Higher!") if number1 < Guess : print("Lower!") attempts += 1 if attempts == 6 : print("You have ran out of guesses") totalattempts += 5 attempts = 1 game = False if mypoint == 1 : print("You gained one point, whilst i gained none.") time.sleep(2) print("My points", aipoint, "Your points", mypoint) time.sleep(2) print("Now lets continue.") if mypoint != 1 : print("You gained no points, whilst i gained one.") time.sleep(2) print("My points", aipoint, "Your points", mypoint) time.sleep(2) print("Now lets continue.") time.sleep(2) print("Lets let round 2 commence.") time.sleep(2) game = True if attempts != 1 : print("Game broken there may be a error in the code or a one off bug please restart and try again!") broken = True while broken == True : numero print("Restart", numero) "round two below here" while game == True: print("Attempt", attempts, "/ 5") time.sleep(1) Guess = int(input("take your guess..(1-30)")) if number2 == Guess : print("Correct.") time.sleep(1) mypoint += 1 totalattempts += attempts attempts = 1 game = False if number2 > Guess : print("Higher!") if number2 < Guess : print("Lower!") attempts += 1 if attempts == 6 : print("You have ran out of guesses") totalattempts += 5 attempts = 1 game = False "round two above here" print("Round two is over.")