# Arup Guha
# 9/10/2020
# Turtle with if, random
# Let's user choose shape AND whether or not it gets filled.

import turtle
import random

# Get the shape
shape = input("Do you want a circle or a square?\n")

# Will set to true if they want the shape filled.
fill = False

# See if they want it filled.
wantFill = input("Do you want your shape filled(yes/no)?\n")

# Update our Boolean variable fill.
if wantFill == "yes" or wantFill == "Yes" or wantFill == "YES":
    fill = True

# Only if we want to fill.
if fill:
    turtle.begin_fill()
    turtle.colormode(255)
    turtle.fillcolor((10, 50, 150))


# Will allow 3 versions of circle, all other answers are square.
if shape == "circle" or shape == "Circle" or shape == "CIRCLE":

    # Pick a random radius.
    radius = random.randint(50, 150)

    # Draw it!
    turtle.circle(radius)

# Square
else:

    # Pick a random side length
    side = random.randint(100, 300)

    # Repeat the same stuff four times.
    turtle.forward(side)
    turtle.left(90)
    turtle.forward(side)
    turtle.left(90)
    turtle.forward(side)
    turtle.left(90)
    turtle.forward(side)
    turtle.left(90)

# Now, let's complete the fill.
if fill:
    turtle.end_fill()
