# SuperLogo and the turtle: learning by drawing [Programming guides](README.md) In turtle drawing, you are the programmer. You give instructions and the turtle follows them. As it moves, it can leave lines behind. That is how your code becomes a drawing. People have been programming this way for a long time. SuperLogo is one of the programs that helped children discover it. ## First came Logo The first version of the programming language **Logo** was created in 1967. Seymour Papert, Wally Feurzeig and Cynthia Solomon were among the people who worked on it. They wanted children to explore and make things with computers. Read more in the [history of Logo](https://el.media.mit.edu/logo-foundation/what_is_logo/history.html). Logo did not have a turtle at first. It could also work with words and sentences. The turtle came later and became a familiar way to learn the language. See [What is Logo?](https://el.media.mit.edu/logo-foundation/what_is_logo/index.html). ## From a robot to SuperLogo The turtle was first a real robot that moved across the floor. It could draw with a pen. Later, the turtle appeared on a computer screen. The [Logo Foundation](https://el.media.mit.edu/logo-foundation/what_is_logo/history.html) describes how this happened. Different programs were made that used Logo. **SuperLogo** was one of them. You could give turtles instructions and work with shapes, pictures and animation. It was a place to make your own projects too. Developers and researchers describe this in [History of Logo, section 5.3.5](https://web.media.mit.edu/~lieber/Publications/History-of-Logo.pdf#page=48). SuperLogo was an inspiration for Pliro. Pliro has its own programming language, but you can explore the same kinds of drawing ideas with it. ## Think like a turtle Imagine that you are the turtle. You have a place where you are standing and a direction you are facing. **Forward** means walking in that direction. **Turning right** means turning on the spot towards your own right. If you face down the screen, your right is the opposite way from when you face up the screen. With the **pen down**, you draw as you walk. With the **pen up**, you move without leaving a line. It is like lifting a pencil off the paper. You can try this without a computer: walk a few steps forward, turn a quarter-turn to your right and repeat. After four sides, you are back at the start. ## Let Pliro draw a square This example uses Pliro code: ```pliro # language: en penUp() home() clear() penDown() for side in [1, 2, 3, 4]: forward 80 right 90 ``` The first four instructions put the turtle in the middle, make it face upwards and clear the drawing. The pen goes down again only after that. The **loop** repeats the two indented instructions four times. Each time, the turtle draws a line of 80 steps and turns 90 degrees. That is a quarter-turn. Four quarter-turns make one full turn of 360 degrees. Change 80 to 120. The square gets bigger, but its corners stay the same. ## Why does a triangle need a 120-degree turn? Now try three sides: change the list to `[1, 2, 3]` and the turn to `right 120`. At each corner, the turtle turns away from the direction it was walking. You measure its turn, rather than the angle inside the triangle. Three turns of 120 degrees add up to 360 degrees again. This draws a triangle with three equal sides. For a hexagon with equal sides, you can repeat six times and turn 60 degrees each time. Predict what will happen before you try it. ## A mistake can teach you something If the drawing does not join up, follow the instructions one at a time. Is the distance right? Does the turtle turn far enough? Does it repeat enough times? That is programming too: thinking of something, trying it and improving it. The picture helps you see what your instructions do. [All turtle commands](turtle.md) · [The history of Pliro](history-of-pliro.md) · [The Pliro IDE](pliro-ide.md)