#Trisha Ruiz
#6/9/2023
#balloon deflation game

import turtle
import random
turtle.shape("turtle")
turtle.colormode(255)

#init game
radius = random.randint(10, 150)
guess = 0

while(radius > 10):
    
    #make balloon
    turtle.penup()
    turtle.goto(random.randint(-200,200), random.randint(-200,200))
    turtle.pendown()
    
    turtle.fillcolor((random.randint(0,255),random.randint(0,255),random.randint(0,255)))
    turtle.begin_fill()
    turtle.circle(radius)
    turtle.end_fill()
    
    #deflate balloon
    shrink = int(input("How much should we shrink the balloon?\n"))
    radius = radius - shrink
    guess += 1
    
    #update balloon drawing
    turtle.reset()    

#win/lose check    
if(radius < 5):
    print("YOU FAILED! YOU BROKE OUR BALLOON!")
else:
    #make balloon
    turtle.penup()
    turtle.goto(random.randint(-200,200), random.randint(-200,200))
    turtle.pendown()
    
    turtle.fillcolor((random.randint(0,255),random.randint(0,255),random.randint(0,255)))
    turtle.begin_fill()
    turtle.circle(radius)
    turtle.end_fill()
    
    print("You win! You  took",guess,"guesses")
