Reputation: 896
How would I go about checking the patch colors of the patches that are above, below, to the left and to the right of each patch? I know I would embed it in a ask patches [ insert code here ] statement, but I don't know what to put in that ask statement.
Upvotes: 2
Views: 1738
Reputation: 9142
To ask the turtles to show the colors of the 4 patches around each one of them just
ask turtles [show [pcolor] of neighbors4]
Upvotes: 2