Lesson 3

Making a Square

Now that we can know how to move our turtle around, let’s try and get it to draw some shapes.

The first shape we will try to draw is a square. Before we go any further, try and code it yourself! What combination of movmements would make our Turtle draw a square?

The image to the side contains some sample code for drawing a square with our Turtle.

Once we have drawn our square, we will want to ‘erase’ it to set up for more shapes. On line 36 add the following code: turtley.clear()

Drawing a Circle


Now, lets try and make our Turtle draw a circle for us.

On line 39 add the following code turtley.circle(100)

This will result in our Turtle drawing a circle, with a radius of 100. Test the code, and make sure it works!

The radius is only one of the parameters that the circle function asks for.

The first parameter for the circle function is Radius. This will determine how big the circle is

The second parameter is the Extent. This determines how much of the circle (in degrees) is drawn. Giving it a value of 180 would result in a half circle.

The third parameter is the Steps. This determines how many sides the circle will have

In order to fully understand how these parameters work, we will need to see them in action.