Slow turtle

B

Brent W. Hughes

I'm using the turtle graphics module and am trying to teach it to my kids.
The slowness of the turtle in drawing things is good at first because it's
fun watching it do its thing. But now we'd like it to go faster so it
doesn't take to long to see what it is producing. Is there a standard way to
speed it up, or am I left with sifting through the source code to fix it
myself?

Brent
 
P

Peter Otten

Brent said:
I'm using the turtle graphics module and am trying to teach it to my kids.
The slowness of the turtle in drawing things is good at first because it's
fun watching it do its thing. But now we'd like it to go faster so it
doesn't take to long to see what it is producing. Is there a standard way
to speed it up, or am I left with sifting through the source code to fix
it myself?

If you are only interested in the final picture, you can use tracer(False).
Otherwise reducing the delay or dividing nhops by a fixed number seem most
promising. E. g.

262c262
< nhops = int(distance)
---
nhops = int(distance)/5
273c273
< self._canvas.after(10)
---
self._canvas.after(1)

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top