"""
Mondrian Pictures in Python
"""

# Import Modules
from graphics import *
from random import *

# Height & Width
pic_width = 600
pic_height = 600

win = GraphWin(title = "Cooper's Coffee", width = pic_width, height = pic_height)
win.setCoords(0,0,pic_width-1, pic_height-1)
win.setBackground("gray")

# Rectangles (all possible)
grid1 = Rectangle(Point(0,0), Point(200,200)) 
grid2 = Rectangle(Point(200,200), Point(400,400)) 
grid3 = Rectangle(Point(400,400), Point(600,600))
grid4 = Rectangle(Point(0,200), Point(200,400))
grid5 = Rectangle(Point(0,400), Point(200,600))
grid6 = Rectangle(Point(200,400), Point(400,600))
grid7 = Rectangle(Point(200,0), Point(400,200))
grid8 = Rectangle(Point(400,0), Point(600,200))
grid9 = Rectangle(Point(400,200), Point(600,400))

#List of grid spaces
position_list = [grid1, grid2, grid3, grid4, grid5, grid6, grid7, grid8, grid9]

# Rectangle creation
rect1 = choice(position_list)
rect1.setFill(color_rgb(randint(0, 255), randint(0, 255), randint(0, 255)))
rect1.setWidth(8)
rect1.draw(win)

rect2 = choice(position_list)
rect2.setFill(color_rgb(randint(0, 255), randint(0, 255), randint(0, 255)))
rect2.setWidth(8)
rect2.draw(win)

rect3 = choice(position_list)
rect3.setFill(color_rgb(randint(0, 255), randint(0, 255), randint(0, 255)))
rect3.setWidth(8)
rect3.draw(win)

win.getMouse()
win.close()

