Programming the turtle

The Logo programming language for children was created by Seymour Papert at MIT in the seventies.
The turtle moves like you and me.
It starts from where it is and goes forward, backward, right or left.
You can move the turtle by tapping the buttons at the left of the screen.
When the “pen” is down, the turtle draws pictures.
This game is a powerful introduction to geometry and programming.
There are two versions of the app: for the iPad and for the Macintosh desktop.
The iPad version works only on iOS up to 11. It does not work on iOS12. Click here to see it in the iTunes store (where you can buy it for $1.99) and download it to your iPad.
Click here to download the free desktop version to your Macintosh computer.
As I am registered as an iOS developer but not as a MacOS developer, you may have to open the System Preferences of your Mac, then click the Security & Privacy icon, click the lock and select “Allow apps downloaded from anywhere” the first time you open Mad Logo.


When you tap the buttons at left, the turtle moves forward 100 pixels and then turns right 90 degrees. Doing it four times draws a black square over the blue one.
Move the mouse over the picture to see another way to draw the square. When you tap the turtle, it moves by following the instructions of the “script” at right.
The Logo language has two basic commands: fd and rt. Then it uses words like repeat and if.


Logo scripts are very simple but can be quite powerful.
In the Mad Logo program, the turtle draws many strange and beautiful geometrical figures.
The example above shows a very simple shape and the custom command, snowflake, that lets the turtle draw the shape.
Move the mouse over the picture to see what happens when you repeat a small version of the shape many times.
This manner of repeating shapes at a smaller scale is the core idea of what mathematicians call “fractals.”
Nature seems to work this way quite often.


This turtle race is programmed (more or less) with a Logo script.
The buttons at left control the turtle. You can move faster or slower, turn 15 degrees left or right.
If you go too fast and don’t turn soon enough, you crash. Your speed falls to zero and you lose lots of time. But if you drive too carefully, you also lose lots of time.
The number of steps appears in the white panel. Good scores are entered into the game’s hall of fame, which is displayed when you tap the white panel.
Move the mouse over the picture to see the two-turtle version of the game.