Do the homework in the file called Jul3_AdvancedTurtleDrawing and submit it into the google drive when you are finished.
Continuing the code shown below, convert the shape into a function that can be used to draw the shape at any given x and y coordinate.
# Jul3_AdvancedTurtleHW import turtle as t import random as r t.bgcolor("lightblue") t.speed("fastest") def makeRectangle(x, y, width, height, c): t.penup() t.goto(x, y) t.pendown() t.color(c) t.begin_fill() for i in range(2): t.forward(width) # width t.right(90) t.forward(height) # height t.right(90) t.end_fill() # how to make a circle def makeCircle(x, y, radius, c): t.color(c) # moving locations t.penup() t.goto(x, y) t.pendown() t.begin_fill() t.circle(radius) # radius t.end_fill() # transform this into a function with x and y coordinates that you can set makeRectangle(0, 0, 200, 200, "black") makeCircle(100, -150, 50, "red") makeCircle(20, -50, 20, "blue") makeCircle(170, -170, 20, "green") makeCircle(170, -60, 20, "yellow") def makeShape(): # implement this makeShape(200, 0) makeShape(-200, -200)
If you have any questions, you can email me at ddjapri@ayclogic.com!!