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
block. Similarly, the for block lets us simplify long scripts.
Steps
- Use your
pinwheelblock to create a more specializedasteriskblock. - Make a new clock called asterisk.
- Two variables are used, one for length of branch and one for number of branches

- Fill in “pick random 3 to 30” for branches
- Fill in “pick random -10 to -90 for backup
- Fill in “pick random 10 to 90 for size
- Write another version of
polygon. - Use primitive blocks (
move,turn). - We used
to name a variable. - Import the for tool.
![for (i) = (1) to (10) [say (i) for (2) secs] for (i) = (1) to (10) [say (i) for (2) secs]](https://bjc.edc.org/bjc-r/img/1-introduction/for-i-1-10-say-i.png)
- Modify above so that the say block is repeated going up by even numbers until 30.

- switch the order of the 100 and the 1 in the
forblock in the spiral script. - Change the inputs to
turnandmoveto 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: