Teaching 211 F '05 Assignments Set 1 Set 2 Set 3 Set 4 Set 5 Set 6 Set 7 Set 8 Set 9 Set 10 Set 11 Set 12 Set 13 Set 14

### Problem Set 12

If you run any of the functions (as opposed to just testing them), comment out the code for running the functions before you submit your solution.

N.B.: Tests are not runs. A test is when you evaluate an expression and compare it to some expected result, while a run is when you evaluate an expression without anticipating any particular result for the expression.

Due date: 12/02 @ NOON

This problem set is optional. You will not get any credit for completing the problem set, but you are encouraged to do so and to check with the TAs when you encounter problems.

The goal of this problem set is to understand accumulators with some small problems and, as it is more common, in the context of somewhat larger problems. As you will see, in the context of real problems accumulators often show up inside of data representations of problem data instead of extra arguments to functions.

HtDP Problems:

31.3.3, 31.3.4, 31.3.7

Plus one of the following two problems:

The "Missionaries and Cannibals" Problem:

Solve all problems in section 32.2 of HtDP. Also design a function that creates an image from a given state representation. Use it to illustrate the problem solving process, once you know that the problem is tested and runs. Hint: you may want to turn the states of the solution into a movie and use `run-movie` from world.ss to show how to solve the problem.

This section shows you how you can design data representations that include accumulated information.

The "Peg Solitaire" Problem:

Solve all problems in section 32.3 of HtDP. Also design a function that creates an image from a given state representation. Use it to illustrate the problem solving process, once you know that the problem is tested and runs. Hint: you may want to turn the states of the solution into a movie and use `run-movie` from world.ss to show how to solve the problem.

 last updated on Sat Nov 26 15:34:41 EST 2005 generated with PLT Scheme