Programming Assignment Checklist: Recursive Graphics

Frequently Asked Questions

I forget how to do geometry. Any hints? Here are the coordinates of the critical endpoints. Click the image for a bigger version.

Sierpinski triangle geometry

How do I draw a filled triangle? Use StdDraw.filledPolygon().

How should I go about doing the artistic part of the assignment? This part is meant to be fun, but here are some guidelines in case you're not so artistic. A very good approach is to first choose a self-referential pattern as a target output. Check out the graphics exercises in Section 2.3. Here are some of our favorite student submissions from Spring '07. See also the Famous Fractals in Fractals Unleashed for some ideas. Here are some more ideas. Some pictures are harder to generate than others (and some require trig); consult a preceptor for advice if you're unsure.

What will cause me to lose points on the artistic part? We'll deduct points if your picture is overly boring or too similar to HTree, Sierpinski or Brownian. For example, replacing the calls in Sierpinski.java from triangles to squares will result in a deduction because the goal is to learn about recursion and you have only changed the non-recursive part. You will also lose points if your artwork could more easily be created without recursion, e.g., it is tail-recursive: a single recursive call at the very end of the function.

Can I use GIF or JPEG files in my artistic creation? Yes. If so, be sure to submit them along with your other files. Make it clear in your readme.txt what part of the design is yours and what part is borrowed from the image file.

My function for Art.java takes several parameters, but the assignment says that I can only read in one command-line argument N. What should I do? Choose a few of the best parameter values and do something like the following:

if      (N == 1) { x = 0.55; y = 0.75; n = 3; }
else if (N == 2) { x = 0.55; y = 0.75; n = 5; }
else if (N == 3) { x = 0.32; y = 0.71; n = 8; }

Can I use the mouse to control input values? Check with your preceptor.

Testing and Submission

readme.txt. Use the following readme file template and answer all questions.

Submission. If you don't follow these instructions, you risk annoying your grader and losing a significant number of points.

Possible Progress Steps

These are purely suggestions for how you might make progress. You do not have to follow these steps. Note that your final Sierpinski.java program should not be very long (ours is around 15 lines, not including comments and blank lines).