Notes/Hints/Suggestions for the Sierpinski Gasket problem

In any recursive method, it is helpful to use "wishful thinking" to solve the general case. The wishful thinking strategy says that you can assume that the method you are defining simply works on a "smaller" problem. The goal is then to figure out how to glue solution(s) to the smaller problem(s) to make the solution for the whole problem.

As a concrete example, suppose you are trying to draw sierpinski(4,200), which you want to yield the following picture:

In this case, an appropriate smaller problem for the wishful thinking strategy is sierpinski(3,100), which yields the following picture:

Now, to define the general case, you just need to figure out how to combine three copies of the smaller picture to form the bigger picture. You need to think carefully about the position and heading of the turtle after it draws each smaller picture, and moving it to an appropriate place to draw the next picture. You also need to make sure that the turtle ends up in the same position and heading as where it started after finishing drawing all three smaller pictures.