# File: ChapterGraphics/polygonBuild.py
# Asks for a list of Points and draws a polygon
from graphics import *
def main():
# win.setCoords( 0, 0, 500, 500 )
L = [] #list of Points is empty
ans ='y'
while ( ans == 'y' ):
x = input( "Point x? " )
y = input( "Point y? " )
P = Point(x,y)
L.append( P )
ans = input( "Continue(y/n)? " )
win = GraphWin( "Build a Polygon", 500, 500 )
shape = Polygon(L)
shape.setFill( "green" )
shape.draw( win )
main()