import random, easygui
secret = random.randint(1, 100)
guess = 0
tries = 0
easygui.msgbox("""AHOY! I'm the Dread pirate Robert, and I have a secret!
It is a number from 1 to 99. I'll give you 6 tries.""")
while guess != secret and tries < 6:
guess = easgui.integerbox("What's yer guess, matey?")
if not guess: break
if guess < secret:
easygui.msgbox(str(guess) + " is too low, ye scurvy dog!")
elif guess > secret:
easygui.mgsbox(str(guess) + " is too high, landlubber!")
tries = trise +1
if guess == secret:
easygui.mgsbox("Avast! ye got it! Found my secret, ye did!")
else:
easygui.mgsbox("No more guesses! The number was " + str(secret))
secret = random.randint(1, 100)
guess = 0
tries = 0
easygui.msgbox("""AHOY! I'm the Dread pirate Robert, and I have a secret!
It is a number from 1 to 99. I'll give you 6 tries.""")
while guess != secret and tries < 6:
guess = easgui.integerbox("What's yer guess, matey?")
if not guess: break
if guess < secret:
easygui.msgbox(str(guess) + " is too low, ye scurvy dog!")
elif guess > secret:
easygui.mgsbox(str(guess) + " is too high, landlubber!")
tries = trise +1
if guess == secret:
easygui.mgsbox("Avast! ye got it! Found my secret, ye did!")
else:
easygui.mgsbox("No more guesses! The number was " + str(secret))