MCS-177 Project: Quilting
Due: Friday, September 20, at the beginning of class
MCS 177: Computer Science I, Fall 2002
Recommended preparation and
schedule
Problem
In this project, you will use the basic quilting procedures introduced
in section 1.3 to write more sophisticated procedures for constructing
complicated quilts
such as the Repeating Crosses pattern shown on page 15 of the
text. Initially, some of the procedures you write will generate
recursive processes, as described in chapter 2. Once you have
well-written, working procedures, you will use techniques from chapter 3 to rewrite them so that
they generate iterative processes instead.
Project Report
We will assign a specific audience and style for each project report;
you should pay attention to these, because they will vary from project
to project. In this first project report, you will pull together the
code you wrote and the testing you did, in a concise but clear and
organized fashion, for an audience already familiar with the project.
As such, you need not tell a self-contained story. Instead, you
should group the code and testing into logical sections, with
a descriptive heading for each section and a clear caption on each
procedure or set of test cases.
For this first project, we recommend you prepare your project report
with DrScheme itself. Even though it isn't much of a word processor,
it is adequate for a simple report like this, and using it will save
you the hassles of cutting and pasting your code and images into a
real word processor.. We have a separate document with tips on using DrScheme to write a
report.
To get some sense of how this project report will be
graded, look at the grading sheet
that we use.
In lab
- Launch DrScheme. We recommend using the definition window for all
of your definitions and using the interaction window only for quick
experiments which you are unlikely to repeat. Save the program file
early and often.
- To load into Scheme the definitions of the basic blocks,
evaluate the following expression:
(load "~mc27/labs/quilting/quilting.scm")
by typing the line into your
definition window and hitting execute. Now you should be able to see
each block by evaluating its name in the interaction window. In
addition to the blocks mentioned in the book, we have also included
two solid blocks, black-bb and white-bb.
(On machines outside our lab, you will need to have installed the functional
graphics tool, and then you can download quilting.scm and load it in.)
- The
stack and quarter-turn-right
procedures are built into our Scheme. Try them out as in exercise 1.8
on page 16 of the text, and make sure you understand what each does
and how combinations behave. (We should point out here that the code
from the book is available from the web page http://www.gustavus.edu/~max/concabs/code/ ;
simply follow the link for the chapter you want. Using these files
will substantially reduce your typing.) Note that names such as
rcross-bb continue to name the same, unmodified basic
block throughout. The procedures give you back transformed copies of
the image rather than changing the original image in any way.
- Do exercise 1.9 on pages 16-17. (We'll bring the card-stock
basic blocks to lab to help you think these through.)
Be sure to save your definition window early and often. (Just click
the Save button.) Note that the next time you use DrScheme, you can
simply open this file by using the File menu.
- Do exercise 1.10 (page 17).
- Read the paragraph at the beginning of section 2.4 and do
exercise 2.13 (page 40).
- Do exercise 2.14 (page 40).
- Read the paragraphs after exercise 2.14 and do exercise 2.15
(page 42). Note: be sure to carefully read the
paragraph preceding exercise 2.15 before starting to program.
- Do exercise 3.3 (page 54).
If you have time
- Produce your own basic blocks; see exercise 1.11 on pages
17-18. (Sorry, we don't have any way of providing graphical input to
Scheme.)
- You may find other interesting ways to replicate images beyond
pinwheeling and checkerboarding. For example, you could combine
rotated versions of a basic block, some of which have been inverted
and others not. You might also try using the built-in procedure
mirror-image. Be creative!