On this page:
1 Chip the Cheap Sheep Cashes Out
2 Project submission
6.12

Assignment 5: Many, Many, Many

Due: Wednesday, October 3, 11:59:59 PM EST.

The following should be completed in cooperation with your assigned partner from lab 1. (Partner assignments are listed on Piazza.)

You must use the design recipe to receive full credit for this assignment. You must also follow The Style guidelines.

1 Chip the Cheap Sheep Cashes Out

Create a file chip.rkt for this part of the assignment. Use the standard file header at the top of the file. Complete the design of the Chip program we started September 21, 2018. Chip should run to the boundaries of the screen and turn around. Refine the program so that Chip turns around as soon as the edge of its image touches the boundary (instead of midpoint). Add a key handler function that causes chip to change direction when any key is pressed.

You may use the following images for Chip:

Create a file chips.rkt and use the standard file header. Design a variant of the Chip program that has two sheep that start off on opposite sides of the screen and run toward eachother. When their heads butt, they should “bounce” off running the other direction. The left sheep (notice that the sheep can never pass each other) should be controlled with the "a" and "d" keys for changing direction toward the left and right, respectively. The right sheep is controlled with the left and right arrow keys as before.

Here’s a little animation of a sample running of this program:

(You do not need to add the “POW!” functionality, but may if you have the time.)

It should go without saying that this program should be designed using the design recipe and style guidelines. In particular make sure you use defined constants so that parameters of the program can be changed without breaking anything.

2 Project submission

Submit both chip.rkt and chips.rkt directly to the submit server by uploading it.