Monday, October 29

Last 3 numbers; Logo

Today we are going to finish the last three numbers across the top of the keyboard.  They are the 3 (L2), the 6 (R1), and the 2 (L3).

So far in Logo we have learned how to move our turtle forward, back, and change directions by using the left or right commands.  In addition we have also learned the abbreviations for all four of these commands:  FD, BK, LT, RT.  We also have learned HOME, PU, PD, HT, and ST (see if you can remember what those mean!).

Today we are going to add another command to our arsenal of Logo commands, and it is the REPEAT command.  What this allows us to do in Logo is to use the same command over and over without having to type it over and over.  For example, if I wanted to move forward 200 turtle steps I could enter FD 200. But, using the REPEAT command I could enter REPEAT 2 [FD 100].  Another example:  say I wanted to turn right 90 degrees...using the REPEAT command I could enter REPEAT 3 [RT 30].  Both of these examples may seem a little unnecessary, but this should help you to understand how the REPEAT command works.  In the near future we will be creating much more intricate designs, which will require more difficult statements to write.  Because of that we'll be using the REPEAT command to help simplify writing these powerful statements - without a REPEAT command it would be much more difficult.

We'll start with Exercise 3 - in these problems you need to rewrite each series of statements using a REPEAT statement.  Then we'll move to writing statements using the REPEAT command to create a series of designs

No comments:

Post a Comment