to setup ca crt 100 ask turtles [ ifelse random 2 = 0 [set color yellow] ; color half the turtles red [set color red] ; the other half yellow rt random-float 360 fd random 10 ] ask patches [ set pcolor green ; color the patches green ] end to go ;; turtle procedure rt random-float 90 lt random-float 90 fd 1 ; if you're a red turtle, set the color of the patch you are on to black if (color = red) [set pcolor black] ; if you're a yellow turtle, set the color of the patch you are on to magenta if (color = yellow) [set pcolor magenta] wait 0.1 ; slow it down end @#$#@#$#@ GRAPHICS-WINDOW 279 10 613 365 40 40 4.0 1 13 1 1 1 CC-WINDOW 6 137 269 302 Command Center BUTTON 63 38 118 71 NIL setup NIL 1 T OBSERVER T BUTTON 134 38 189 71 NIL go T 1 T TURTLE T @#$#@#$#@ WHAT IS IT? ----------- This code example demonstrates Turtle-Patch communication. When a red turtle moves onto a patch, it turns the patch black. When a yellow turtle moves onto a patch, it turns the patch magenta. This does the same thing as the "stamp" command. @#$#@#$#@ default true 0 Polygon -7566196 true true 150 5 40 250 150 205 260 250 @#$#@#$#@ NetLogo 2.0beta4 @#$#@#$#@ setup repeat 28 [ ask turtles [ go ] ] @#$#@#$#@ @#$#@#$#@