Reputation: 117
in simple words what I am struggling to do is:
if (colour of any patch = red) then execute some code
Upvotes: 1
Views: 3222
Reputation: 30453
if any? patches with [pcolor = red] [
print "yes, there is at least one red patch"
]
Upvotes: 3
Reputation: 9152
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
Upvotes: 0