|
Lesson 1: First steps |
|
©1997/1998 Sebastian Golze, Thomas Hirsch
und
|
[1_First_steps] [2_Turn_left_turn_rigth] [3_With_colors] [4_Procedures] [5_Parameters] [6_Loops] [7_More_parameters] [8_Stars] [9_Upload_and_Download] [10_LOGO_learns_to_write]
Hi and hello ! These ten lessons will teach you, how to speak to LOGO. You just have to follow a few simple rules. LOGO's language (also called LOGO) has got words, sentences and texts just like every other language. They only look a little different. Most of the words LOGO knows are commands. There's for example the command go, which tells LOGO to go forward. It's so easy. Nevertheless, LOGO can't do anything with a simple command. Imagine somebody telling you to "go". You wouldn't know if you're supposed to go 10 meters, 100 meters or if he wants you to go home. You see - you always need a whole sentence. Fortunately, a sentence in LOGO is very short, because it does not contain any superfluous word. You don't even have to put a full stop at the end, or to use capitals. Thus, the sentence go 100 is enough to tell LOGO that he has to go 100 steps forward. That's not so far for a turtle. Besides, Everything in a sentence except the command is called parameter. That's Greek and stands for "what is around". Such a parameter can be a number, but also a whole mathematical expression or - as you will see later - a word. LOGO is quite good at mathematics, so he is able to understand sentences like go 100+50 or go 5*10/2. He knows all four basic operations and brackets. Furthermore, there is something like a paragraph. You call it procedure and program. A procedure is simply a collection of sentences in a certain order that tells LOGO how to do something. And a program is a collection of procedures. Imagine a program like a manual about something he wants to draw. A procedure would be a chapter in this manual which deals with a certain step. Finally, here is a simple program consisting of one procedure... procedure main Every procedure is introduced by the command procedure followed by its name. If you give LOGO a program that you want him to draw, he first searches a procedure called main. He executes all the commands "in" this procedure until he comes to the word end. This simply tells him that the procedure is finished now. Now it's up to you to do something: Just try how many steps LOGO needs to get to the border of the paper. You need this to know how large the figures you draw can be. But be careful not to get off the paper. LOGO wouldn't notice this, he is occupied doing exactly what you told him to do. |