Showing posts with label repeat_command. Show all posts
Showing posts with label repeat_command. Show all posts

Wednesday, October 19

More Logo

  • NEW SEATING CHART!!  We will be moving at the beginning of class to a new seat.  After you get logged in at your new location, you will want to bookmark the following websites:

www.google.com
www.classmarker.com
www.edmodo.com
http://gmsamazon*.wikispaces.com/  (change the * to your class hour)
  • You will be required to type in your usernames and passwords on your new computer the first time you visit these sites.  They will not be "remembered" as they were on the other computer you sat at. 
  • If you have not yet completed your vocab definitions on your wikispaces website you need to get that done immediately.
  • Don't forget, the crossword puzzle is due tomorrow.  If you are done now you can hand it in early.
  • We will be covering your REPEAT assignment from yesterday - get it out.  This was not for a grade, but we will go over the answers today in class.  At the same time I will answer any questions you might have concerning any of the problems that you worked on.
  • The next assignment you will have is Practice #2, in which you will be creating designs using a REPEAT statement to draw designs.  My guess is that you will want to use Logo so that you can "experiment" as you are trying to create the designs.  You will also be working with a partner, so at the end of the hour today you will hand your paper in (so it doesn't get lost).  This Practice #2 will be due tomorrow (Thursday).

Tuesday, October 18

REPEAT command in Logo

Today we will cover a new command in Logo called REPEAT.  This command allows the user to simplify drawing shapes by telling Logo to REPEAT a direction a stated number of times.  For example, if you are drawing a square, you are really just drawing the same thing four times in Logo (fd 100 rt 90 fd 100 rt 90 fd 100 rt 90 fd 100 rt 90).  Instead of typing in the same thing 4 different times we can tell Logo to REPEAT the directions we give it - in the case of a square we would want it repeated 4 times.

When using the REPEAT command there are several things to keep in mind.  First, there is no abbreviation for the REPEAT command, so you'll have to just type in REPEAT.  Second, when using the REPEAT command you need to first tell Logo how many times you are going to repeat something; then you'll need to enter the instructions you want Logo to repeat in brackets (they look like this  [  ], and are found above the Return key on your keyboard ).

REPEAT statements in Logo can be written in several ways - statements can be only REPEAT commands, they can contain REPEAT commands, they can have multiple REPEAT commands, or REPEAT commands can be inside other REPEAT commands (this is called nesting, and is an advanced concept in programming).  In other words, I can create a square using only a REPEAT command.  Do the following:  REPEAT 4 [fd 50 rt 90].  This will create a square.  Now, try this in Logo (clear your screen first):  fd 50 REPEAT 4 [fd 50 rt 90] .  You should get something that looks like the letter P.

Logo reads the information in a REPEAT statement by knowing that when it sees REPEAT, its going to repeat the instructions inside the brackets the number of times that are listed after the word REPEAT.  For our square example above, Logo will repeat the instructions in the brackets - [fd 50 rt 90] - 4 times.

As a reminder, the crossword puzzle is due on Thursday - don't forget to get that completed and handed in.  You are welcome to turn that in early if you want.

Vocab quiz #5 (Internet #1) is on Friday, Oct. 21.  If it's your week to define words get that done first in class today instead of the work we are doing!