count-breed-at-with
xcor ycor [condition]
Parameters:
xcor |
Number |
number of steps in the x-direction from the caller |
ycor |
Number |
number of steps in the y-direction from the caller |
[condition] |
List of turtle commands |
list of commands that returns true or false |
Description:
Returns the number of turtles of the breed specified that are xcor units away in the x-direction and ycor units away in the y-direction from the caller, and also satisfy [condition].
Examples:
if count-cars-at-with 1 1 [color = red] > 1 [fd 1]
will have all of the turtles move forward who have more than one red turtle of breed cars 1 unit away in the x-direction and 1 unit away in the y-direction