How to Help the Turtle Escape

The turtle knows when to stop and has a few ways to pick the next points. We can pull these methods together into a program to try them all out. We want to be able to see what he’s up to as well. The Python turtle package is ideal for showing movement from one point to another, and spirangles are often used to demonstrate its power. It comes with Python, so you don’t need to install anything else. That’s handy!

Turtle graphics pre-date Python, originating from the Logo programming language, invented by Seymore Papert.[8] The original version moved a robot turtle. He wrote a significant book with Marvin Minsky Perceptrons: an introduction to computational geometry [MP69] paving the way for later breakthroughs in ...

Get Genetic Algorithms and Machine Learning for Programmers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.