150 pages, dozens of
illustrations. Perfect for kids.


In chapter 6 of Lauren Ipsum, N. Veterate Tinker teaches our hero how to use a mechanical turtle to draw figures. She learns a simplified version of the programming language Logo. Type commands into the window on the left, and click GO. Click SAVE to show off your masterpiece. Scroll down for help and hints. Enjoy!

Get the source on GitHub.

Tinker's Turtle understands a very basic vocabulary, one command per line.

Draws a dot on the paper, wherever the turtle happens to be.

MOVE distance
The turtle walks forward some distance, in whatever direction his nose is pointing.

REPEAT number-of-times
This allows you to tell the turtle to do whatever it just did multiple times.

With just these three commands you can tell the turtle to draw a line of dots:

The turtle turns in place left or right, by some number of degrees. If you TURN RIGHT 360, the turtle will end up exactly where it started. If you TURN LEFT 180 it will make one half-turn.

Now, all of that DOT MOVE 12 stuff can get really boring to repeat. So let's add a really clever idea.

DEFINE command [arg1, arg2, ...]
Creates a new command (function/procedure/subroutine/etc). Everything up to the next empty line becomes part of that command. For example, let's write a command to draw a LINE. Now you can use LINE just like you use DOT, and draw a square.

You can even make a new command for drawing squares, and get REALLY fancy!

Instead of making DOTs, you can tell Tinker's Turtle to draw thin lines instead. Just tell it to leave his pen down:

Or even use them together!

COLOR color
Change the color of the pen.

SPEED number
Make the turtle go faster or slower. By default he runs at 200 pixels per second.

Like it? Buy Lauren Ipsum in paperback, for Kindle, iBooks, or the Nook.

Copy & Paste this link:

Share on Facebook Close