It's kind of hard to answer this question without code, but if you know what the colored turtles are called, you can use:
[turtle name goes here].forward([distance])
to move that given turtle forward
[turtle name goes here].backward([distance])
to move it backward
[turtle name goes here].right([degrees/radians])
[turtle name goes here].left([degrees/ radians])
to turn the turtle right and left
for example:
#names the turtle Angie
Angie = Turtle()
#changes the color of Angie
Angie.color("blue")
#moves angie forward
Angie.forward(100)
This should work, hope this helps! :-)
def polygon(length, sides, color):
turtle.color(color)
turtle.begin_fill()
for i in range(sides):
turtle.forward(length)
turtle.left(360.0/sides)
turtle.end_fill()
turtle.penup()
turtle.forward(length*1.5)
turtle.pendown()
polygon(100, 6, "green")
polygon(100, 3, "blue")
polygon(100, 4, "red")
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.