Logo Interpreter

Put your Logo command.

History

Logo was developed in the late 1960s at Bolt Beranek and Newman, Inc., in Cambridge, MA by W. Feurzeig, D. Bobrow and S. Papert. Its purpose was to teach children to program. Its central feature is that it provides simple commands for moving a 'turtle' on a surface. Initially the language was used to direct the motion of a small robot that was dressed up to look like a turtle. It was placed on a sheet of paper and dragged a pen underneath it, thereby drawing figures on the paper. Today the 'turtle' is a small arrow-like figure that moves on the screen of a computer. Underneath, Logo is very much like Lisp, the list-processing language used in Artificial Intelligence, the branch of computer science that tries to make machines behave intelligently. However, it also has features of other languages, including Pascal.

Drawing Commands

The simple Logo drawing commands move the turtle forward and backward and turn it right or left. The commands and their abbreviations are given below:


            fd forward
            bk backward
            rt right
            lt left
            cs clearscreen
        

Each of these commands must be followed by one value called its argument. The arguments for fd and bk are units; those of rt and lt are angles which can be any integer. Of course, a rotation by 360 is a complete rotation so a rotation by 375 degrees is the same as one by 15 degrees.

The graphics window has a coordinate system. The values of the two coordinates (normally called x and y) at the center are 0, 0. At the northeast corner they are 250, 250; at the southeast corner, they are 250, -250; at the southwest corner, they are -250, -250; etc. If the turtle tries to walk off one side of the screen, it wraps around. The right side wraps to the left side and the top wraps to the bottom.

To save time and space Logo provides the repeat command. The following command has the same effect as those given in the above example. The square brackets indicate that the enclosed commands are to be executed three times.


            repeat 3 [fd 60 rt 120]
        

Reference: Logo Tutorial