Skip to content
How to make a colorful spiral of turtles with turtle stamp.
Profile icon
Alice688

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:
https://www.w3schools.com/python/python_intro.asp

Heres a picture of the final result:

Screen Shot 2020-08-22 at 1.16.47 PM


1.

First create a repl with python with turtle.
Screen Shot 2020-08-22 at 1.10.50 PM

Then import the turtle and random modules.

import turtle import random

2.

Make your turtle a turtle shape.

turtle.shape('turtle')

Lift your turtle so it doesn't draw one straight line.

turtle.penup()

3.

Create a variable for the distance your turtle moves(paces).
Twenty paces is the minimum but you can do more.

paces = 20

4.

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)

5.

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.

turtle.stamp()

6.

Add more paces
Once again, 3 is the minimum but, you can do more.

paces += 3

Move forward by the new number of paces.

stamp.forward(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.

stamp.right(25)

Finish

Thats it, you have made a spiral of turtles.
I hope you enjoyed this, if you have any advice please comment.

You are viewing a single comment. View All
Profile icon
k9chelsea2

nice

Profile icon
k9chelsea2

also if you use a # in markdown you need to put a whitespace after the # and before the text if thats what you where trying to achieve

Profile icon
Alice688

@k9chelsea2
Thanks, I edited it.

Profile icon
k9chelsea2

k nice

Profile icon
k9chelsea2

also the finish at the end needs a whitespace as well if you where doing the big text thingy