## CSci 1301: Lab 5

You may work in pairs (preferred) or individually.

#### What to submit

At the end of the lab please send me and your group partner(s) all your Scheme files as e-mail attachments. My e-mail is elenam at morris.umn.edu. The subject of your e-mail must be "1301 Lab 5" followed by "Final" or "Not final", depending on whether this is a final submission or you are still working on it. If you need to finish it, make sure to set up a time with your group partner(s) to finish the lab.

#### When to submit

Due Monday, October 25th, at 11:59pm. If you submit the final version during the lab, you are done.

#### Lab task (20 points): drawing movement

Finish the in-class exercise as specified in comments at the end. Specifically you need to:

1. Write a function to generate a list of coordinate shifts randomly (or use an existing function: we wrote a function to generate a random list of integers). Carefully think of the range. Pass the range (the minimum and the maximum values) as parameters to the function.
2. Use the function in question 1 to generate a list of x-shifts and y-shifts. Check your answers. Name these two lists for future use.
3. Use the function `draw-and-clear-all-shapes` to draw the entire moving face picture.
4. Copy all the drawing and clearing functions into a new file. Define another complex shape instead of a face (such as a car or a house or any shape of at least three simple shapes). A complex shape is a list of simple shapes. If you are planning to change the size of the shape, make sure its size is passed as a parameter.
5. Write a function that generates new coordinates for the shape. It can be a directional move (a car is driving, a baloon is flying away) or a change in size (a tree becoming smaller as the viewer moves away). Keep in mind that new coordinates are relative to the original (the very first) position of the shape. You might need two functions: one for x coordinates, and one for the y coordinates, depending on your moves.
6. Use the function `draw-and-clear-all-shapes` to draw the entire moving picture. When calling this function, pass to it your complex shape and lists of x and y coordinates that determine the movement, as generated by the functions in part 5. You must have at least 5 moves. Note that you must use the functions as described above. Drawing the images "by hand" will not get credit.
7. Be creative. The most intersting drawings will get extra credit.
8. You may add other drawings to your cartoon (but keep it simple). There will be no vote, but the most creative drawings will be posted.

The views and opinions expressed in this page are strictly those of the page author. The contents of this page have not been reviewed or approved by the University of Minnesota.