Wednesday, September 30, 2015

Nesting Repeats

It is also possible to nest one repeat block inside another. Since Snap! processes scripts from top to bottom, the first repeat will begin first, and the second repeat will have to complete its entire process before the process of the first repeat is called again.
  1. Predict what this script will do without building:
    1. How many times in total will the script say "Hip"?
    2. How many times in total will the script say "Hooray"?
  2. You'll want to use the pen down command tells the sprite to set its penpoint down to draw.
  3. Here is another script that has nested repeat blocks.
    squares in nested repeats
    1. Sketch on paper what you expect it to do.
    2. Build it and try it out.
    3. Embed one more repeat (move, turn) loop between move 50 steps and turn right 90 degrees.

No comments:

Post a Comment