# oneSquare.py
#Rhys Price Jones  3 September 2015
# To run in Canopy you will need to set the PyLab backend to Inline(SVG)
# Instructions:
    
from turtle import *

# Draws a square of side len in the given color
# Ends up where it started with the pen up
def square(len, color):
    pd()
    pencolor(color)
    fd(len)
    lt(90)
    fd(len)
    lt(90)
    fd(len)
    lt(90)
    fd(len)
    lt(90)
    pu()

def biColorSquares(num, len, gap, color1, color2):
    if num>0:
        square(len, color1)
        fd(len+gap)
        biColorSquares(num-1, len, gap, color2, color1)
        bk(len+gap)
            
# For Macs only:
getscreen()._root.attributes('-topmost', True)
getscreen()._root.attributes('-topmost', False)
biColorSquares(5, 50, 5, 'red', 'blue')
exitonclick()

