O'Reilly logo

Learn to Program with Small Basic by Ed Price, Majed Marji

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required