[Back]

Using the StarLogo Reference Manual



The tutorial that you have just completed was downloaded from the StarLogo web site. To get to this web site, open your web browser, and go to the url http://www.media.mit.edu/macstarlogo. This is actually the home page for the particular version of StarLogo that we are using. When you look at this web site, on the left of the browser you will see a menu. Click on Documentation, and in the next menu click on Reference Manual. Now you have a list of the commands that you can use in StarLogo, with some descriptions of what they do. Scroll down through this page. It's a little long, but don't worry; we won't be using all of these commands.

Notice that the commands are divided into different sections. We will only be using some of these sections, such as the following.
Commands Affecting Turtles
Commands Affecting Patches
Colors
Breed Commands
Variable Commands
Mathematical Commands
Flow of Control Commands

Some of these sections have subsections, also. Within each subsection, the commands are alphabetized. Most commands sound like what they do, so this can make it easier to look up a command to do what you want to do.

No programmer I know has all of the commands in any programming language memorized! There are just too many commands. Instead, it is important to know how to find commands that you don't have memorized. This means being comfortable with looking stuff up in the reference manual. This is the purpose of this exercise.

Use the StarLogo Reference Manual to answer the following questions. Try out the new commands that you learn on your computer! And remember, commands that do similar sorts of things are grouped together into sections, so for example a good place to start looking for the command to change the direction that your turtles are facing would be in the Commands Affecting Turtles section and the Turtle Headings subsection. Don't forget to have fun!

  1. Some commands tell all of the turtles to do something, and some tell only a particular turtle to do something. For example, setxy 3 5 sends all of the turtles to the patch at (3, 5), but setxy-of 2 3 5 sends only the turtle with ID number 2 to the patch (3, 5) (try this!). List 4-6 more commands that affect all turtles. List 4-6 more commands that only affect a specific turtle, like turtle number 2.
  2. Suppose that you forgot how many turtles you had: how would you find out how many turtles there are?
  3. How would you find out how many red turtles you have?
  4. What command would you give the turtles to tell them all to draw a trail behind them as they move?
  5. What is a breed? How would you create the breed "frog"?
  6. How would you create 10 frogs?
  7. How would you find out how many frogs there are?
  8. In the Command Center window, tell StarLogo to compute the following.
    (a) 8 x 16
    (b) |-7|
    (c) the largest whole number less than 3.8
    (d) the square root of 4
  9. What command tells StarLogo to give you a random number? Write down four random numbers given to you by StarLogo.
  10. Find a command in the Reference Manual that you haven't used yet and play around with it to figure out what it does. Write a small procedure that uses your command. Write one to three paragraphs explaining what your procedure does.

You are welcome and encouraged to talk to the people sitting around you about the questions. Exploring StarLogo will be more fun if you can share what you figure out with other girls!