from cs1lib import * from random import randint, uniform def circle_art(): set_clear_color(0, 0, .3) set_fill_color(.5, .8, 1.0) set_stroke_color(1, 1, 1) # create a new bubble every few seconds # (note: better to use a named constant than .025) if uniform(0, 1) <= .025: x = randint(0, WINDOW_WIDTH - 1) y = WINDOW_HEIGHT + RADIUS xc.append(x) yc.append(y) clear() # your code here; draw and move all the circles for i in range(len(xc)): draw_circle(xc[i], yc[i], RADIUS) yc[i] -= 1 RADIUS = 10 # radius of circles WINDOW_HEIGHT = 200 WINDOW_WIDTH = 200 FRAME_RATE = 20 xc = [] # empty lists to store yc = [] # circle centers start_graphics(circle_art, 1600, framerate = FRAME_RATE)