Ask

ask who instruction-list

Temporarily tells each element in the first input to run the instruction list. The first input can be the name(s) of one or many turtles or text box names. Ask does not change the current turtle or text box. The apostrophe can be used to ask a turtle to report something. Turtles have built-in properties: pos, heading, color,size, pensize and shape. Variables can be assigned to turtles using turtlesown.

Examples:

There are many turtles on the page.

ask [t1 t2 t3] [fd 50 rt 90 fd 50]

If you have two text boxes on the page and you want to keep Text1 current:

ask "text2 [print "hello]

If t1 is not the current turtle and you want to know its position:

show ask "t1 [pos]

Following are three examples of equivalent instructions:

show ask "t1 [pos]

0 0

show t1's "pos

0 0

t2, setpos ask "t1 [pos]

t2, setpos t1's "pos

show ask "t1 [gravity]

10

show t1's "gravity

10