Remember how to draw an equilateral triangle? Write a block that takes a size as input and draws a triangle. (We aren't going to use that block itself on this page, but you're going to write a more complicated riff on triangles, so first you have to know how the simple one works.)
You're going to build a fractal, like the tree
fractal in that you specify a size and a level, and higher levels make more complicated pictures:
At level 1, the result of calling the block should be an equilateral triangle:
At level 2, each side of the triangle should be extended with a half-size triangle:
(Don't click unless you really, really need a super big hint.)
Here are levels 3 and 4:
Okay, finish writing the code. Then try a pretty big level number, 9 or 10, inside a warp
block.
Your finished product should have produced a shape sort of like this:
but with lots of small line segments instead of the grey parts. This should suggest an alternate way to make the shape: Level 1 is a triangle, level 2 is three level-1 versions arrayed around an empty triangle, etc. Write the code for that and compare the two results.