CS 307: 4. Snow and Trees  Due: Wednesday, September 26, 2001
This exercise introduces several examples of fractal structures,
that is, structures where the same pattern is repeated at
smaller scales. For these problems, use the turtle graphics
functions that you wrote for the last assignment.    1. A
Sierpinski gasket is formed from an equilateral triangle with
holes cut out of it in the following way. Lines are drawn
connecting the midpoints of the sides of the triangle, forming a
new equilateral triangle in the center; this triangle is cut out
and removed, leaving three smaller triangles in the corners. The
same treatment is applied to the smaller triangles, recursively.
Write a function (sierpinski lng n) that draws a Sierpinski
gasket with a triangle whose largest side is of length lng and
which has a recursion depth of n. The gasket should be drawn
from the current position and orientation of the turtle. Note
that we do not want to draw the part that is cut out -- only the
part that is left. When