Assignment 3

CSC 115 -- Fall 2002

Objectives:

 

Introduction:

This fun assignment allows you to experience the creation of some very pretty simple graphics using both recursion and a "turtle". The turtle is a simple object that simply knows a point on a screen. It draws lines by moving from its current point to another, adopting the last point as its current position. It is analogous to drawing on paper without ever taking the pen off the paper. The curves in the assignment belong to the set of fractal drawings. Fractals use recursive techniques to apply a formula to each "piece" of a previous curve. A demonstration of the turtle churning out these curves will be presented in the lab classes. Be sure you attend.

Requirements:

  1. Create a UML class diagram of this program. 
  2. Finish the Sierpinski routines C and D and makeCurve.
  3. Program the cross curves recursively using the given class structure. That is, write two classes Cross and DrawableCross, where DrawableCross should extend Cross and implement the interface DrawableCurve
  4. Add the Cross Curve as another curve on the frame that is instantiated with SpaceFill  (you also need to extend the user interface to include Cross as an option).

Recursive Construction Rules:

These pages illustrate the recursive construction rules for the curves we are using in this project: (please note that the graphic y-axis points down, as opposed to the mathematical y-axis, which points up).
  1. Hilbert Curves
  2. Sierpinski Curves
  3. Cross Curves

The following code is given to you and, except for  the SpaceFill.java addition, should not be altered. You can compile and run SpaceFill, it just isn't finished for the Cross curve:

Rules & Hints

And the regular.....

Due Dates and What To Turn In

There is no part A due for this assignment, but you are strongly encouraged to attend the lab!  This assignment is due by 6pm on Tuesday November 5th.  Submit the following *.java files electronically.


Instructor Note

If you find any errors or inconsistencies in this document, report them immediately to csc115@csc.uvic.ca. Notification of changes (or clarifications) will be posted on the csc 115 webboard and on the course web page.