# Maria Mauco
# 6/6/2024
# confetti

import turtle
import random

turtle.colormode(255)
turtle.speed(0)

# Draw 500 pieces of confetti
for i in range(500):

    # Move turtle to random point
    x = random.randint(-500, 500)
    y = random.randint(-500, 500)
    turtle.penup()
    turtle.goto(x, y)
    turtle.pendown()

    # Pick a random color to fill the confetti
    r = random.randint(0, 255)
    g = random.randint(0, 255)
    b = random.randint(0, 255)
    turtle.fillcolor(r, g, b)

    # Choose a shape randomly
    shape = random.randint(1,3)
    
    turtle.begin_fill() # begin filling the shape

    if (shape == 1): # draw a cricle
        turtle.circle(random.randint(5, 25))
        
    elif(shape == 2): # draw a triangle
        side = random.randint(10, 30)

        for i in range(3):
            turtle.forward(side)
            turtle.left(120)
        
    else: # draw a square
        side = random.randint(10, 30)

        for i in range(4):
            turtle.forward(side)
            turtle.left(90)
        
    turtle.end_fill()
