tags:

views:

14

answers:

2

in simple words what I am struggling to do is:

if (colour of any patch = red) then execute some code

A: 

Only a turtle can check the pcolor. So this works:

ask turtles [show pcolor]

But this does not work (typed in on the Observer> prompt):

show pcolor
Jose M Vidal
but i need to use the pcolor condition with if statement, in the go procedure. for exaplme: if any patch has a red colour then execute some code. thanks
A: 
if any? patches with [pcolor = red] [
  print "yes, there is at least one red patch"
]
Seth Tisue