5DRAWING SHAPES WITH TURTLE GRAPHICS

image

In Chapter 3 you learned how to draw pictures using code, but in Small Basic you can program a friendly turtle to draw pictures for you! In this chapter, you’ll explore the Turtle object. You’ll also learn how to use a For loop to repeat lines of code a set number of times to draw beautiful designs.

Meet the Turtle

Enter this statement in the Small Basic Editor:

Turtle.Show()

Now click Run. Presto! A turtle should appear in the center of the graphics window (Figure 5-1), waiting for your commands.

image

Figure 5-1: ...

Get Learn to Program with Small Basic 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.