CS 117 Assignment, Due midnight 2/19/96

Patches

Hand in via HSP. You may work with a partner.

Your goal is to write two procedures, each of which will draw a picture within a rectangle specified by the procedure's parameters.

To get started, you should run a program of mine. Execute it by typing

/Accounts/courses/old-courses/cs117-w95/patch

in response to the Unix prompt. Run this program a bunch of times, trying various values for the input. What does my picture look like if you give it a tall skinny rectangle? A square? A big rectangle? A little one?

Your job is to write two procedures.

  1. A procedure that will draw the same picture that the program "patch" draws (you may change the colors).
  2. A procedure that will draw any picture you wish.

In both cases, you must draw a line around the outside of the given rectangle, and your picture may not slop outside that line.

Your procedures should begin with the following:

procedure DrawPicture( left, bottom, width, height : integer );

You may change the name DrawPicture, but you may not change the number or meaning of the parameters.

On Wednesday, 2/21, we will meet in the lab and put your patches together into a cyber-quilt. It's important for you to get your patch in on time so I can get Wednesday's lab ready.

Questions? Ask me Monday.



Jeff Ondich, Department of Mathematics and Computer Science, Carleton College, Northfield, MN 55057
(507) 663-4364, jondich@carleton.edu