Painted Turtles for StarLogo TNG

Posted August 30, 2016 by turtle
Screen shot of image made by painted turtles

Original author

Project GUTS, based on Adventures in Modeling (Colella, Klopfer, and Resnick).

Resource type

Content area

Use type



Running the activity

  1. Show the students where to find the StarLogo TNG program (a shortcut icon on the desktop would be best, but may need to start it in the program files).
  2. Instruct the students how to open StarLogo TNG.
  3. Show the students some key features of StarLogo TNG: the code window, the drawers, the columns, Spaceland, and the cameras.
  4. Tell the students that StarLogo TNG always starts up with two turtle agents  located near the center of Spaceland. 
  5. Show that you can click on a turtle in Spaceland to find out more about it.
  6. Show Spaceland’s coordinate system in the Terrain Editor.
  7. Open a turtle’s monitor to see where it is located (xcor, ycor).
  8. Show how a forward block can be dragged onto the code area and double clicked to have all turtles execute the forward command.
  9. Show how the forward command takes an “argument” or number block to tell it how many steps to take forward. 
  10. Show the students how to clear Spaceland with a clear everyone block
  11. Show students how to create 10 new agents using the create block  (reiterate that the create block takes an “argument”, the number of turtles to create.)
  12. Ask the students to figure out how to get the new turtles to take 20 steps forward. 
  13. Ask them why they think the turtles formed a circle?
  14. Introduce the concept of heading and degrees.  
  15. Clear the screen again and create new agents using a Setup block.
  16. Show how to use the scatter block to scatter the agents.  Describe how scatter works and what would be the analogous situation with dice.
  17. Next introduce a forever block and talk about the execution model.  (Each time through the forever loop each turtle gets updated.  Also if a number of commands gets executed before the end of the loop, the final position is what gets drawn.)
  18. Put a forward block into the forever block and watch what happens when the forever block is clicked.
  19. Now add a pen-down and see what happens.  Do you see the trail drawn after each step the turtles take?  Or do they seem to jump?  What is happening?
  20. Next show how to make the agents “wiggle” describing the right turn and left turn blocks with a random number of degrees (try 20).
  21. Go into some detail about random and what is happening when random is called.  
  22. Talk about probability?  What if random is given a larger number as its argument?  What will happen?
  23. Now run setup and forever and see the result. 
  24. * if time allows, ask students to change the variables (number of turtles, number of steps or turn angle in the random function)_until they find an outcome they like.  Then have them share their creations and setting during a pin-up or show and tell.

Concluding the activity:

Wrap up questions:

  • What did you see happen?
  • Is it a complex system?  What’s missing?  (sensing and reacting to other agents or the environment at the local scale)
  •  “Does the same pattern emerge regardless of the settings of the variable?” 
  • Review the new terms used in this activity: agent, simple rules, location, heading, steps, iteration, setup, runtime, patterns, random, initial condition.
Log in or register to view attachments and related links, and/or join the discussion