How to make a colorful spiral of turtles with turtle stamp.
How to make a spiral of turtles
So this is pretty simple, but you'll need to know python basics first.
If you don't know the language check out this website:
Heres a picture of the final result:
First create a repl with python with turtle.
Then import the turtle and random modules.
import turtle import random
Make your turtle a turtle shape.
Lift your turtle so it doesn't draw one straight line.
Create a variable for the distance your turtle moves(paces).
Twenty paces is the minimum but you can do more.
paces = 20
Start a loop to repeat the stamping code.
You can repeat any number of times.
for i in range(50):
Assign a random function to a variable called 'random_red' to pick a random red value.
Assign a variable for blue and green as well.
random_red = random.randint(0, 225) random_blue = random.randint(0, 255) random_green = random.randint(0, 225)
Set the turtle color as the randomly chosen rgb (red, green, and blue) values.
turtle.color(random_red, random_blue, and random_green)
Now stamp your turtle.
Add more paces
Once again, 3 is the minimum but, you can do more.
paces += 3
Move forward by the new number of paces.
Finally, slightly turn your turtle right as it moves to start spiraling.
Please put the turn as 25, if you put another number it might not become a spiral.
Thats it, you have made a spiral of turtles.
I hope you enjoyed this, if you have any advice please comment.