Turn left, turn right (lt, rt )

Help Contents The Logo Turtle Turn left, turn right (lt, rt )
Dancing turtle ( fd, bk ) More things to do

Turn left, turn right (lt, rt )

Stepping forward and backward will soon become a boring dance unless you figure out how to make the turtle turn to the left and to the right.

Because of this is very important, the turtle already knows how to do it and it just waits for your orders.

To make it turn to the left or right just say lt (it comes either from left or from left turn) or rt (right, right turn).

Of course the turtle expect from you not only to say in what direction to turn, but also how much to turn.

This how-much is expected as an argument to lt and rt and it must be in the form of degrees.

What are degrees?

Degrees have been used by ancient mathematicions to measure angles. Because of these we still use them nowadays to express numerically the 'size' of an angle.

How big is one degree?

There is no simple explanation. A mathematician will say that there are 360 degrees in a circle, but it's hard to imagine 1/360th of a circle.

When was you last time eating a slice of pizza? Do you remember how much slices the whole pizza was cut into?

If there were 6 slices then the angle of each slice would be 60 degrees.

If there were 8 slices - each fo them would be 45 degrees.

Pay attention that the angle of a slice does not depend on the size of the pizza. If you cut a 10" and a 20" pizza into 6 slices each, then all twelve slices will have the same angle of 60 degrees.

The other way to represent the size of one degree is to look at a clock or a watch with arrows.

The tiniest arrow which measures seconds, turns 6 degrees to the right each second.

So, one degree is 1/6th of a turn of the seconds arrow.

There is no problem if the seconds arrow is missing. The minutes arrow turns 6 degrees per minute, thus a slice of 1 minute is 6 degrees big.

A slice of one hour it exactly 30 degrees. Three hours are 90 degrees. Remember this number - 90 degrees.

When we, people, say to each other turn to the left, we mean turn 90 degrees to the left.

The Logo turtle is a computer creature and it does not behave like us. That's why you must always say the angle of turning even if it seems obvious for you.

Now, lets try a small example:

fd 5
lt 90
fd 5
lt 90
fd 5
lt 90
fd 5

If you were a turtle and follow strictly these instructions, you should draw a square.

You go 5 steaps forward, turn to the left, again walk 5 steps, turn to the left, go 5 steps, turn to the left, and make the final 5 steps.

Now let's make stairs to the right:

repeat 10 [
fd 5
rt 90
fd 5
lt 90



Dancing turtle ( fd, bk ) More things to do