SETTURTLES

Syntax

SETTURTLES number

Explanation

SETTURTLES defines the total number of turtles available. They range from 0 to the input of SETTURTLES minus 1. For example, SETTURTLES 16 will create the turtles [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]. Logo starts up with 16 turtles defined and turtle 0 activated.

SETTURTLES creates turtles with the following characteristics: SETTURTLES accepts any number between 1 and 32767 as input. The number of turtles is limited by the memory of the computer system on which Logo is operating. TURTLES returns the number of turtles that have been defined with SETTURTLES.

Use the TELL, ASK, EACH, and WHO commands to access multiple turtles.

Example

? SETTURTLES 16

? TELLALL 0 15

? EACH [SETPC \

? WHO SETH \

? 360/16*WHO]

? FORWARD 30

?