Turtle Activity

Numbers Commands

The numbers commands allow you to perform math in your commands.

numbers menu - needs updating

number – specify the number you want to use in the operation.

 

+ – performs addition: 5 + 3 = 8

 

- – performs subtraction: 5 – 3 = 2

 

X – performs multiplication: 5 x 3 = 15

 

/ – performs division: 5 / 3 = 1.67

 

mod – gets the remainder after division: 5 mod 3 = 2 [That is, 5 / 3 = 1 r. 2]

Turtle_Art_img_42

This is similar to the example for the repeat, but in this case we are changing the color each time it repeats. We take the current value of color (which is 0 the first time through) and add 2 to it, giving us 2 for the color on the second loop, 4 for the third and so on.

One note on the color: If you increase the color value each time then when it gets to be more than 99 it starts over again at 0.