Comp210 Lecture # 28    Fall 2002

Sierpinski Gaskets continued...

So far we have

Now we want to automate the building process to build a gasket of arbitrary size:

  1. Write an natural number visitor NVisitor to make the n levels of growing:
    1. Base case: create a full-sized base case gasket.
    2. Inductive case: grow (once) the recursive result.
  2. Can we abstract this more --> searching for factories.
  3. Another way of doing all this? Functional style vs. object style.

Today's code: lec28.scm

Helper code: sierpinski.scm

 

©2002 Stephen Wong