# ALlison Obourn
# CS 115, Autumn 2021
# Lecture 24

# This program draws three rows of circles on a tall thin
# panel with a grey background. The rows are perfectly horizontal.
# Each circle is 20 wide and tall and placed directly after the circle
# before it with no gap. The first row is in the top left of the panel
# in yellow and contains 5 circles. The middle row is about halfway down the
# panel a little to the right of the left edge and contains 10 in blue.
# The last is towards the bottom, on the right side, 8 long and light red.

from ECGUI import *

def main():
    panel = drawing_panel(300, 700, "#CCCCCC")
    
    draw_row_of_circles(panel, 0, 0, 5, "yellow") 
    draw_row_of_circles(panel, 300, 20, 10, "blue")
    draw_row_of_circles(panel, 600, 150, 8, "#FF9999")


# draws a horizontal row of circles 20 by 20 each on the passed
# in panel. The top of all of the circles is at the passed in y and 
# the left side of the first circle is at the passed in x. The rest of the
# circles are placed so that each is horizontally right after the one before
# it. circle_count number of circles are drawn in the passed in color.
def draw_row_of_circles(panel, y, x, circle_count, color):
    for i in range(0, circle_count):
        panel.fill_oval(i * 20 + x, y, 20, 20, color)



main()
