M2L3A5&6 Amelia Faison and Haley Foard

Storyboard:

We will use our existing pinwheel block to make asterisk and polygon blocks, usiing abstraction.

The goal is to create other, simpler special-purpose procedures that each do a particular job.

Use for loops to repeat and count the repetitions so you can use that counter to draw shapes with repeated patterns.

Logic

To make the asterisk do a particular job, we used our previous project to help us.

We modified the pinwheel function to make a simple polygon.

To make it change the number of sides we will add a item of list block then put all the options of number of sides in a list so that it would choose random.

To draw shapes, we used the the repeat block   block. Similarly, the for block lets us simplify long scripts.

Steps

  1. Use your pinwheel block to create a more specialized asterisk block.
  2. Make a new clock called asterisk.
  3. Two variables are used, one for length of branch and one for number of branches
  4. asterisk (branches) (length):  pinwheel ( ) ( ) ( )
  5. Fill in “pick random 3 to 30” for branches
  6. Fill in “pick random -10 to -90 for backup
  7. Fill in “pick random 10 to 90 for size
  8.  Write another version of polygon.
  9. Use primitive blocks (moveturn).
  10. We used  for to name a variable.
  11.  Import the for tool.
  12. for (i) = (1) to (10) [say (i) for (2) secs]
  13. Modify above so that the say block is repeated going up by even numbers until 30.
  14. squiral script
  15. switch the order of the 100 and the 1 in the for block in the spiral script.
  16. Change the inputs to turn and move to get a smooth spiral.

Problems:

We continued to have problems with our program making shapes that weren’t necessarily asterisks. We fixed this by insuring that our branch input was equal to the number in the repeat block.

Link:

https://snap.berkeley.edu/snapsource/snap.html#present:Username=haley_foard_apcsp&ProjectName=U1L4-Pinwheel

https://snap.berkeley.edu/snapsource/snap.html#present:Username=haley_foard_apcsp&ProjectName=M2L3-Squiral

Leave a comment