MCS-177 Project: Quilting

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 are providing a template for you to follow as a guide to how a lab report should be organized. You can copy the text from this page (use the edit functions in your browser) and paste the text into a word processor and complete the report.  You can use the word processor that comes with the Linux machines in the lab. You can find the word processor in the main menu's Office submenu, or as a special icon within the main toolbar. If you take this approach, there is no easy way to paste in example images from DrScheme; the simplest alternative is just to staple a DrScheme printout of the images to the back of your report, with references in the body of your report, such as "see image 1." Also, when you copy code from DrScheme and paste it into the word processor, you need to be sure to put it into a fixed-width font such as Courier, in order to preserve the indentation.

Alternatively, you can copy the template text into a Definitions window in Dr. Scheme.  Even though it isn't much of a word processor, Dr. Scheme 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.

Remember to attach a copy of the honor pledge to your report and to sign the pledge.

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. To load into Scheme the definitions of the basic blocks, you'll need to put the following two lines at the top of your definitions window, and click the "Run" button:
        (require (lib "fungraph.ss" "concabs"))
        (load "~mc27/labs/quilting/quilting.scm")
    
    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. (If you want to use DrScheme on machines outside our lab, you should go to the page Using Concrete Abstractions with DrScheme, which explains the whole process of setting up DrScheme. In particular, be sure to read the section Libraries for use with DrScheme., and you can then download quilting.scm and load it in.)

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

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

  5. Do exercise 1.10 (page 17).

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

  7. Do exercise 2.14 (page 40).

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

  9. Do exercise 3.3 (page 54). You may not actually need to rewrite quilt and checkerboard themselves; if all the recursion is confined to helper procedures, only those helper procedures will need rewriting.

If you have time

  1. Produce your own basic blocks; see exercise 1.11 on pages 17-18. If you want to experiment with images generated outside DrScheme, such as photographs, you can insert them into DrScheme using the Insert Image... command within the Special menu. In this case, you may want to transform the image to the standard size by applying the resize-image procedure to it.

  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!

Back to MCS 177 home page