Logo (programming language) facts for kids
Logo is a special programming language that is easy to learn. It was created to help students and children learn how to tell a computer what to do. Logo was designed to work with lists of words, similar to another language called LISP.
The very first version of Logo started running in 1967. It used a very large computer called a mainframe. People typed commands on a machine called a teletype, which was like an old-fashioned printer and keyboard combined. There were no computer screens back then!
In 1969, Logo was used to control a small robot called a Floor Turtle. This robot could move around on the floor. People gave it commands to go forward, backward, left, or right. The turtle even had a pen with different colors, so it could draw lines on the floor as it moved.
Later, a new version of Logo was made that could draw pictures on a computer screen. It used the same simple commands as the floor turtle. This way of drawing was named Turtle graphics.
Today, there are over 170 different versions of Logo. Many of them are free to use because they are open source. You can even find free Logo textbooks online to help you learn. Logo usually works as an interpreted language, which means the computer runs your commands line by line as you type them.
Contents
Try Logo: Simple Examples
Want to see how Logo works? Here are a couple of fun examples.
Hello World: Your First Program
This is a classic first program in many languages. It simply makes the computer say "Hello World!".
First, load the Logo program on your computer. Then, type this line into the command area: `print [Hello World!]`
The computer will then show you: `Hello World!`
Drawing a Spiral with Code
Logo is great for drawing! You can make amazing shapes with just a few commands. This example shows how to draw a spiral using a special programming idea called recursion. Recursion is when a program calls itself to repeat a task.
Using the Logo editor, type in this set of instructions to create a new command called "spiral": `to spiral :size` ` if :size > 30 [stop] ; This tells the program when to stop drawing` ` fd :size rt 15 ; Move forward by 'size' steps, then turn right 15 degrees` ` spiral :size *1.02 ; Call 'spiral' again, making the next line a little longer` `end`
Now, in the command area, type: `spiral 10`
On your screen, you will see a cool spiral shape appear!
Images for kids
See also
In Spanish: Logo (lenguaje de programación) para niños