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.
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. The parameters left, bottom, width, and height, refer to coordinates within the current window, which DrawPicture should assume has been opened by the calling routine. Your DrawPicture must not call createwindow, and it also must not call write, writeln, read, or readln.
Once they are done, I intend to put all your patches together into an on-screen quilt. If you do not follow the restrictions above (staying inside the given rectangle, using parameters properly, and avoiding read, write, and createwindow), the quilt won't work.
Start early, have fun, and stay in touch.