← TurtleLab Lessons

Steps 2 to 4

Steps 2 to 4 worksheet

Name: Date:

Step 2: Say it once. Three turns are done for you. Work out the rest, then test each one in TurtleLab.

ShapeSides (the repeat)Turn
Triangle3120
Square490
Pentagon572
Hexagon6
Octagon8
A shape with 12 sides12

The rule: turn = ÷ the number of sides

Step 3: Let chance draw.

  • The smallest number random 0 255 can give is . The largest is .
  • 50 rays, each turning 7.2, turn the turtle in all.
  • With 100 rays, each ray turns to go all the way around.

Step 4: Choose a path. The turtle starts facing up (heading 0). A coin of 1 turns it right 90. A coin of 2 turns it left 90. The first row is done for you.

FlipCoinThe turtle turnsHeading after
11right 9090
21
32
41
52
62

In my own program, the if and else decides