"""
A small program to draw a collection of randomly-positioned,
differently-colored, differently-sized circles on the screen.

Author: Zachary Palmer
Date: 2015-09-28
"""

from graphics import *
from random import *

def make_circle(color, size):
  position = Point(randrange(20,780), randrange(20,780))
  circle = Circle(position, size)
  circle.setFill(color)
  return circle

def main():
  window = GraphWin("Circles",800,800)
  window.setBackground("green4")
  
  circle1 = make_circle("red4", 60)
  circle1.draw(window)
  
  circle2 = make_circle("yellow2", 40)
  circle2.draw(window)
  
  while window.isOpen():
    window.getMouse()
    circle1.undraw()
    circle2.undraw()
    
    circle1 = make_circle("red4", 60)
    circle1.draw(window)
  
    circle2 = make_circle("yellow2", 40)
    circle2.draw(window)
  
main()
