Snap Projects, March 2, 2012, Cardinal Forest Elementary School

Snap website

Snap is available online - about Snap.

back to more Snap! projects

    Part 1: drawPolygon

  1. Spinning Polygons Snap

  2. Choose 'make a block':

  3. Select 'motion' for the block's category. Type 'drawPolygon' for the name of this new block

  4. Click on the '+', this will let us create an input to this block.

  5. Name this input 'sides'. This variable will represent the number of sides we want for our polygon

  6. Use a repeat block. Drag 'sides' onto this repeat block for the number of times.

  7. Drag a formula block from the 'operators' menu into the turn block: __ divided by __

    For the formula, use 360 divided by the number of sides. This equals the angle we need to turn for all regular polygons.

  8. To run this program of blocks, use: clear, pen down, drawPolygon 5. This draws a pentagon. Try other shapes too, like a triangle, hexagon, and octagon.

PART 2: Spin Polygon

  1. Now we'll extend this program to spin polygons. Choose make a block, and name this block spinPolygon

  2. Add one input variable named 'numberOf Polygons':

  3. Use a repeat block in our new block for SpinPolygon. Drag 'numberOfPolygons' onto the repeat block:

  4. Add the formula: 360 divided by 'numberOfPolygons' on a turn block. Put this turn block into our new block definition.

  5. Run the program: clear, pen down, spinPolygon 20 times. This will draw 20 pentagons spinning in a circle.

  6. To change from a spinning pentagon to spinning octagon, 'edit' your block definition. Change the number of sides from 5 to 8:

  7. Try spinning other kinds of polygons, like triangles and hexagons. Try spinning more than 20 polygons each time.