grab
number [list of commands]
Parameters:
number |
Number |
|
[list of commands] |
List |
|
Description:
Have turtles number execute [list of commands].
Examples:
grab one-of-turtles-here [setc red setc-of partner blue]
This turns the caller red and the grabbed turtle blue. If there are no other turtles on the caller's patch, the [list of commands] does not get executed and no turtles change color.
Notes:
Caller instructs turtles with who number(s) number(s) to execute [list of commands]. The who number of the turtles being grabbed are stored in partner, if there is one, or partners, if there are many. A turtle cannot grab itself.
Grab is only useful for guaranteeing that a turtle you want to talk to is not being talked to by anyone else and cannot talk to anyone else while being grabbed. Note, while one turtle is grabbing another, neither may be grabbed by a third turtle.
Related Commands:
grabbed?
partner
partners