CS111 Lab 6 Solutions

Solutions to the programming problems in lab 6 are presented by first answering the following five questions and then writing the actual code for the problem.

  1. How is the pattern drawn?
  2. What is the base case?
  3. How are consecutive calls to the pattern different?
  4. How do we move into position to draw the next pattern call?
  5. How do we meet the invariant, if any?

The questions are explained in more detail in the Lab 6 description.

Solution code for the problems are available in the lab_solutions/lab6_solutions folder in the /usr/users/cs111/download directory on nike.wellesley.edu.

  1. BoomerangWorld
  2. EiffelWorld
  3. InvertedTriangleWorld
  4. NestedWindowWorld
  5. NestedPolygonWorld
  6. ConcentricRugWorld