'''
Created on Aug 28, 2013

@author: Robert Duvall
'''

def square(alex):
''' 
    function to draw a square
'''
    alex.forward(150) 
    alex.left(90) 
    alex.forward(150)
    alex.left(90) 
    alex.forward(150) 
    alex.left(90) 
    alex.forward(150)
    alex.left(90) 


import turtle               # allows us to use the turtles library
wn = turtle.Screen()        # creates a graphics window
alex = turtle.Turtle()      # create a turtle named alex

square(alex)		    # draw a square by calling a function

# draw a square by running the lines directly
alex.forward(100)           # tell alex to move forward by 100 units
alex.left(90)               # turn by 90 degrees
alex.forward(100)
alex.left(90)
alex.forward(100)
alex.left(90)
alex.forward(100)
alex.left(90)       

# important within Eclipse, wait until I am ready before closing the screen
wn.exitonclick()
