MCS-177 Project: Quilting

Due: February 23, 2001

Problem

There are two basic problems in this project. The first one is to use the basic quilting procedures introduced in section 1.3 to write more sophisticated quilting procedures to help construct 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. The second problem is to rewrite these procedures, using techniques from chapter 3, so that they generate iterative processes instead.

Project Report

In a project report, you will pull together the code you wrote and the testing you did, with a focus on what the reader should learn from your report. In general, each report will have a theme suggested by the project's problem, and the report will develop that theme in a logical and coherent way. When you start writing your reports, you should think carefully about what you find is most important about this project, in the context of information you've gathered in class, in lab, and in your reading. How are you going to tie this information together in a way that makes sense?

A large portion of this particular report will be used to describe the procedures you wrote. There are two standard ways to describe a complicated procedure, a top-down approach and a bottom-up one. In the top-down approach, you begin with the procedure, break it down into smaller, slightly simpler procedures, break those down into still simpler procedures and so on. In contrast, the bottom-up descriptions start with the most basic procedures, describe how those procedures can be used to create more complicated ones, and continue in this manner, ending with the most complicated procedure. You can also describe a procedure by comparing it to a similar one. It's up to you to determine whether a top-down or a bottom-up approach is more appropriate for your lab (given your theme).

When we grade reports, we look carefully at the verbal descriptions of the code so that we can try to determine whether you truly understand how your code works. Also, by demanding that you write clear explanations, we are trying to help you develop an important skill. After you graduate, you will no longer have the luxury of having your writing read by people who already understand what you are explaining. We want to prepare you for that day.

We also look at the code and the testing, to make sure that you wrote accurate and working code and that you tested it adequately.

We've included two documents to give you a better sense for what we expect from your project write-up. The first is a sample write-up for a much shorter project. This sample write-up was done using DrScheme, which isn't really a word processor, so the appearance isn't very fancy. However, we wanted to show the minimum we'd be satisfied with. If you want to do something similar to this with DrScheme, we have a separate document with tips on doing so.

On the other hand, it isn't very hard to make a fancier report using a word processor, such as Applix on the Linux machines, and we recommend doing so. The lab assistants should be able to help, answering questions you might have about this word processor. You should use Copy and Paste to get your Scheme definitions into the word processor, rather than manually retyping them. Students who retype inevitably make typos and wind up handing in procedures that couldn't possibly have worked. You can also Copy and Paste in the same way to get expressions and values from the interaction window, so long as the values aren't images. For the quilt images, Applix has a "Snap to clipboard" feature in the Edit menu that lets you take a snapshot of a portion of the screen, which you can then Paste in. Put your Scheme procedures into the ``Courier'' font. In this font, every character is the same width (like on a typewriter, or in the DrScheme program), so the indentation will line up correctly. If you have problems getting Applix to print, your "preference" settings may not be configured right; a lab assistant should be able to help with this.

The other document to consult is entitled Suggestions for clear reports in computer science courses, which pretty much says it all.

In general, be sure to read through your report and fix any problems you find, either in general presentation or in spelling and grammar. Not only do spelling and grammar errors detract from the clarity of your report, they suggest that you judged the report not to be worth the time to read. If you aren't willing to read your own report, who will be?

You can also get some sense of how this project report will be graded by looking at the grading sheet that we use.

In lab

  1. 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.

  2. If you haven't changed the DrScheme Language from Beginning Student to Full Scheme, be sure to do so now.

  3. 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, download quilting.scm and load it in.)

  4. 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. Write a precise description of what each of these two primitive procedures does.

  5. 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.

  6. Do exercise 1.10 (page 17).

  7. Read the paragraph at the beginning of section 2.4 and do exercise 2.13 (page 40).

  8. Do exercise 2.14 (page 40).

  9. 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.

  10. Do exercise 3.3 (page 54).

If you have time

  1. 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.)

  2. 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!