triangle
is the base case. You can modify it, or create a new block with level and size inputs just like tree
:
If the level is 1, we should see only the triangle:
Otherwise, a half-size child buds at the end of each side of the parent. At level 2, it should look like this:
And at level 3, you should see this:
triangle fractal
.warp
block (to save time) try a big level number, like 8.warp
block (in the yellow Control palette) makes the scripts inside it run faster by not letting any other scripts run or updating the display until it's finished.In order to draw the parent triangle, the sprite must turn 120° between sides. For the fractal you just created, that turning happens after drawing the child, but you could turn before the recursive call, or split the turn, with part before and part after the recursive call.