Fundamentals of Computer Science I: Media Computing (CS151.01 2008S)

Assignment 5: List Iteration


Due: 9:00 a.m., Wednesday, 27 February 2008

Summary: In this assignment, you will report on your work in the lab on list iteration.

Purposes: To encourage you to reflect a bit more closely on the map and foreach! procedures. To give you more experience writing documentation.

Expected Time: Two to three hours.

Collaboration: You must work in a group of size two or size three. (If you need help identifying a group, please let me know.) You may discuss this assignment and possible solutions with anyone you wish. If you discuss this assignment with people other than group members, make sure to include a citation (e.g., “I consulted this person, who helped me do this”).

Submitting: Email your answer to . The title of your email should have the form CSC151.01 2008S Assignment 5: List Iteration and should contain your answers to all parts of the assignment. Scheme code should be in the body of the message.

Warning: So that this assignment is a learning experience for everyone, we may spend class time publicly critiquing your work.

Assignment

1. Provide code and documentation for the “safer” version of image-render-spot! that you wrote in Exercise 3.e of the lab on list iteration.

2. Provide code and documentation for spots-htrans, spots-vtrans, and spots-translate, which you wrote in Exercise 4 of the lab on list iteration.

3. For each of the following expressions from Exercise 5 of the lab on list iteration, explain what effect the expression had, and your understanding of why it had that effect.

  1. (image-render-spots! canvas aardvark)
  2. (foreach! (lambda (spots) (image-render-spots! canvas spots)) aardvark)
  3. (foreach! (lambda (factor) (image-scaled-render-spots! canvas figure factor)) (list 1 2 3 4 5))

4. Complete either Extra 1 or Extra 3 from the lab on list iteration.

Important Evaluation Criteria

We intend to evaluate your assignment on the correctness and elegance of your solutions.

Creative Commons License

Samuel A. Rebelsky, rebelsky@grinnell.edu

Copyright (c) 2007-8 Janet Davis, Matthew Kluber, and Samuel A. Rebelsky. (Selected materials copyright by John David Stone and Henry Walker and used by permission.)

This material is based upon work partially supported by the National Science Foundation under Grant No. CCLI-0633090. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.

This work is licensed under a Creative Commons Attribution-NonCommercial 2.5 License. To view a copy of this license, visit 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.