ASK

Syntax

ASK number or list list

Explanation

ASK causes the turtles named in its first argument to execute the commands in its second argument. ASK makes it possible to send commands to a turtle that is not currently active without making it one of the active turtles.

The first argument to ask can be either a single turtle number or a list of turtle numbers. To ASK a turtle it must be defined with the SETTURTLES command.

See also EACH, TELL, TURTLES, and WHO.

Examples

? ASK 10 [ST FD 30]

Turtle 10 moves forward 30 turtle steps.

? ASK 1 \

? [SETORIGIN [50 0]

? ASK [0 1] [ST]

? ASK [0 1] \

? [REPEAT 4[FD 30 \

? FD 30 RT 90]]

?

Turtle 0 and 1 draw squares.