Turtle, Observer, Patch

alive?-of who number

Parameters:
who number Integer The who id of a turtle

Description:
Returns a boolean. If the turtle with the given who number is alive, it returns true. If the turtle with the given who number is not alive it returns false.

This command is useful when looping over a set of turtle who-numbers. Since each turtle may die between the time you get the who numbers and the time you ask it about itself, you should check alive?-of before using it. A better way to loop over a set of turtles is to use grab because grabbed turtles that try to die will not be allowed to completely die until they are let go.

Examples:
alive?-of 2 returns true when the turtle with who number 2 is alive.

Related Commands:
alive?