repeat
blocks inside repeat
blocks to generate complex pictures.
ST 3/7/18- Brian says:In the script picture just under the pink box, shouldn't the left caption say "with three blue triangles"?
Also, why is this here? Shouldn't this appear later on the page? It's a great image, but it's out of context here. --MF, 3/21/18
repeat
block) and choose "duplicate".move
and turn
blocks of the red triangle, like this. Snap! has a debugging tool called Visible Stepping that allows you to control how quickly Snap! steps through the blocks of your code. This lets you see the effect of each block one-by-one to help you understand any errors in your code.
After clicking the Visible Stepping button (), you can adjust the slider to control the stepping speed. The sprite executes the each step of the code as it is highlighted in cyan.
If you move the slider to the slowest setting (all the way to the left), the shape of the yellow Run/Pause button will change, and you can press it to single step through your code. This can help you see what happens at a specific point.
Does all this copying and pasting of code feel awkward to you? You know a better way: abstraction. In Unit 1 you used a pinwheel
block to implement asterisk
and polygon
, rather than copying the code. Here, you can use a block to manage the abstraction too, but in this case, we want very similar code (a smaller triangle) nested inside, so we will actually use the same block inside itself.
nested triangle
block.
move
and turn
blocks. You can do a similar thing with your block.
nested triangle
block into the editor and insert it in the definition of nested triangle
between the move
and turn
blocks. Make its size input half the current value of size.nested triangle
in its own definition. When a block refers to itself, the block is said to be recursive. Recursion is one of the most powerful techniques in computer science and you will learn more about it in later projects.nested triangle
as a model to define a recursive nested square
block.
I find it odd that we have two images from the TIF in this pink box. Why not use this? --MF, 3/21/18

ST- The image proposed is identical to what we have in FYTD#7 and in the two debugging videos. The animations in the pink box are not the same as in the TIF. The TIF versions involve an animated parameter guiding the changing rotations of the smaller versions of the polygons. Whereas the pink box versions do not have any changing rotations. So I would vote against the change.
My concern is that these images don't look like what the students so on this page. They don't make these images. Right? We don't have to resolve this now though. We can leave this for later. :) --MF, 3/22/18
ST-They actually do. Aside from the color and orientation, these are exactly what the kids work on this page.