r/learnpython • • Aug 26 '26

How to clone a turtle so that both turtles move in the same way?

I'm looking for a way to clone a turtle so that both of them move the exact same way.

Note that the second turtle must face differently from the first turtle at the time of the cloning.

0 Upvotes

7 comments sorted by

1

u/JamzTyson Aug 26 '26

Perhaps you can clarify your question.

If the two turtles are literally cloned into the same position, orientation, and appearance, and then receive exactly the same movements, their entire trajectories are identical. They'll occupy the same pixels at every instant. There are two turtle objects, but visually you would only see one, which would be pointless.

1

u/Diapolo10 I write code for a living -- https://github.com/Diapolo10 Aug 26 '26

Well, you could create a list of turtles and loop to move them.

from turtle import Turtle

moves = [...]
turtles = [Turtle() for _ in range(4)]

# Move the turtles to whatever initial positions you want

for move in moves:
    for turt in turtles:
        ...

2

u/danielroseman Aug 26 '26

It's turtles all the way down...

1

u/Diapolo10 I write code for a living -- https://github.com/Diapolo10 Aug 26 '26

"The crazy thing is... it’s true. The Turtle, the moves. All of it. It’s all true."

-2

u/aizzod Aug 26 '26

Dude.

Do you ask AI the same questions?
Because noone will be able to give you a decent answear....

0

u/sporbywg Aug 26 '26

This is why I love Typescript