def main(): turtle = Turtle() #turtle.setWidth(1) # Length of square length = 40 # Relative distances to corners from origin width = turtle.getWidth() / 2 height = turtle.getHeight() / 2 # Black turtle.setColor(0, 0, 0) # Upper left corner drawSquare(turtle, -width, height, length) # Gray turtle.setColor(127, 127, 127) # Lower left corner drawSquare(turtle, -width, length - height, length) # First random color turtle.setColor(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255)) # Upper right corner drawSquare(turtle, width - length, height, length) # Second random color turtle.setColor(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255)) # Lower right corner drawSquare(turtle, width - length, length - height, length)
def testCurves(): """Display first 7 curves and also level 10.""" for level in range(0, 7): turtle = Turtle() turtle.setColor(0, 0, 0) cCurve(turtle, 50, -50, 50, 50, level)