|
Lesson 7: More parameters |
|
©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]
In the last lesson you have drawn several polygons (that's the name for all closed figures with a certain number of edges, like triangles, squares, pentagons, hexagons, and so on). Now consider (maybe together with others) how you could draw such a figure with a variable number of edges. You will have to use the command repeat and variables which declare the number of edges and the length of the lines. Here's a little hint: To calculate the angle that LOGO has to turn on each edge you will have to divide 360 (a full turn) by the number of edges. That's why LOGO always turns by 90 degrees, when we draw a square: 360 divided by 4 is 90. Remember that LOGO is able to calculate such things by himself. Good luck... Have you finished ? Then you merit standing ovations. If you haven't, replace the length of the lines by a second variable. Now look what happens, when you start that procedure with 360 edges and a size of 1. Can you explain this ? Wow ! That's been a lot of work now. But you will see in the next lesson that you can make really beautiful figures using LOGO. And it's not even hard to do. |