Challenge # 6

You're it!

See if you can implement a game of tag in StarLogo.

Hint: you can keep track of the turtle you tagged by using a turtle variable that keeps track of the "who" of the tagged-turtle. (Also see the QuickDoc on turtle variables)

turtles-own [tagged-turtle]

to set-tagged-variable
  if turtles-here > 1 [settagged-turtle one-of-turtles-here]

end

to change-another-turtle
  setc-of tagged-turtle blue
end

Note: checking to see if there is more than one turtle-here on the patch your turtle is occupying ensures sure that the turtle doesn't set the tagged-turtle variable to -1.

You can look at an example of freeze-tag for more hints.

See the sample projects epidemic and diseases for more information.