Concept: Turtle Graphics Language
& Interface Features
Starlogo allows you to create and
manipulate large numbers of turtles, that move on a two-dimensional surface. The
underlying language and environment features of the Turtle Graphics project are described below.
Language Features
- Turtle Creation: The operation
crt number creates the number of turtles defined by the green number
slider. Questions: How is it invoked? What if it is invoked twice? Three times?
Where are the turtles? What are their colors?
- Turtle Movement: The operation
fd step moves each turtle forward a number of steps. What happens when you chage the value of step (by moving the slider)? What happens when a
turtle reaches the end of the screen?
- Turtle Properties:
- Direction: Every turtle
has a heading in degrees (0 - 359). The operation rt angle turns
the turtle right by a certain number of degrees. What happens to
the pattern a turtle makes
when you change the angle?
How might you make a turtle turn left?
- Color: Turtle color can
be changed with the setc command. (Note: the setc button in this
program is a "forever" button, meaning it continues to change the turtle color; What
would happen if it was not a "forever" button?)
How could you set all of the turtles to the same color?
What if you only wanted to use blue, green, and red?
- Turtle Trails: Each turtle has
a pen that the turtle can put in the up or down position. You can control this using
pu and pd. If a
turtle's pen is down, it leaves a trail wherever it goes. What is the trail color? Does chaning the turtles' pen position change the pattern?
- Slider Variables: number,
step, and angle are all slider variables. You can change these variables by moving the sliders. The turtles each "check" these variables before carrying out an instruction.
- Random Numbers: can be generated
with the random function. For example, random 10 returns a random
number between 0 and 9.
Buttons
- To add a button: Click the button
icon on the toolbar, and then click on the location of the interface window
where you want the button initially placed. A dialog box will come up. Type
in a button name, and the instructions you want the turtle to follow when you press the button
(for example, you might want your turtle to move
fd 10 rt 45 fd 10 rt 45
). You can
either show the name of your button or the instructions.
If you want the turtle to repeat your
instructions forever, click on forever.
- To modify the contents of a button:
Click the button icon on the toolbar; then click on the button you want to
change. You can change the button name, instructions, show name/instructions,
and forever.
- To delete a button: Click the button
icon on the toolbar; then click on the button you want to
delete.
Press the delete key.
- To resize a button: Click
and drag the mouse over the button so that the little square handles appear.
To resize the button, click and drag on one of the handles until the button
is the desired size.
- To Move a button: Click and drag
the button to the desired location.