Due: 4:00 p.m., Tuesday, 2 October 2007
This homework is also available in PDF.
Summary: In this assignment, you will further explore the construction and use of spot lists.
Purposes: To give you experience thinking about lists of
spots. To give you experience with
Expected Time: One hour
Collaboration: I encourage you to work in groups of size three. You may, however, work alone or work in a group of size two or size four. You may discuss this assignment with anyone, provided you credit such discussions when you submit the assignment.
Submitting: Email me your answer. More details below.
Warning: So that this assignment is a learning experience for everyone, I may spend class time publicly critiquing your work.
In our recent labs, you have experimented with creating and manipulating spots, triplets of the form (column row color). We've seen how to draw a sequence of spots, to enlarge spots (and draw a sequence of enlarged spots), and even to translate lists of spots.
Of course, some people have difficulty coming up with interesting collections of spots. Hence, we might write a procedure that helps us do so.
a. Write a procedure,
(image.get-spot image pos),
that, given an image and a position, gets the spot at the given position.
b. Write a procedure,
(image.get-spots image list-of-positions), that gets a list of spots from an image, using a list of positions
to indicate which spots to get. Note that you can write this using
c. Write a procedure,
(position.right-of pos offset), that, given a position and an offset, finds the position offset columns to the right of pos.
d. Write a procedure,
(position.below pos offset), that, given a position and an offset, finds the position offset rows below pos.
e. Write a procedure,
(position.row-of-10 pos), that,
given a position, makes a list of the ten positions in a row, starting
at pos and going to the right. Your procedure will look something
(define position.row-of-10 (lambda (pos) (list pos (position.right-of pos 1) (position.right-of pos 2) ...)))
f. Write a procedure,
(image.get-row-of-ten-spots image starting-pos), that gets ten spots in a row from
image, starting at starting-pos. You should use
position.row-of-10 to build
image.get-row-of-ten-spots, grab a few rows from
an image of your choice and then draw them again (offset horizontally and
vertically) in a new image.
I will primarily look to see that your code is correct. I will also consider
whether you've found a way to use
to draw interesting images.
Please submit this work via email. The email should be titled CSC151.02 Assignment 8 and should contain your answers to all parts of this assignment.
Please send your code as the body of an email message. You should also attach your source image, your result image, and the code you used to create the result.
Thursday, 27 September 2007 [Samuel A. Rebelsky]
I usually create these pages
on the fly, which means that I rarely
proofread them and they may contain bad grammar and incorrect details.
It also means that I tend to update them regularly (see the history for
more details). Feel free to contact me with any suggestions for changes.
This document was generated by
Siteweaver on Mon Dec 3 09:56:00 2007.
The source to the document was last modified on Mon Oct 1 10:55:47 2007.
This document may be found at
You may wish to validate this document's HTML ; ;Samuel A. Rebelsky, firstname.lastname@example.org
http://creativecommons.org/licenses/by-nc/2.5/or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.