6.11.0.4

Week 4 Set b

home work!

Programming Language BSL

Due Date Wed at 9:00pm (Week 4)

Purpose This problem set resumes the graded exercise of Week 4 Set a. It also poses some additional list-processing exercises.

Finger Exercises

Exercise 1 Design the function within. It consumes a list of Posns and a PositiveNumber (r). The function determines whether all Posn are strictly within the circle determined by the given radius (r).

Exercise 2 Design the function bump. It consumes a list of Posns. It increases the x coordinate of each Posn by 1.

Graded Exercises

Exercise 3 Your software architect has approved your wish list from exercise 3, Week 4 Set a. Design the functions now.

In case you have any doubts about your wish list, see a member of the staff during office hours and walk through at least one wish (name, signature, purpose, examples/tests). You must come as a pair.

Hints (1) The functions require two pieces of domain knowledge: (a) moving a turkey and (b) determining proximity of a turkey to a piece of food. Both are provided by the "library" at the bottom of the file. (2) Remember the guidelines from the basic design recipe about "helper" functions. (3) When you discover a bug, check your test case, your function, and both. In rare occasions, both are wrong (4) When you can play the game and things go wrong, formulate a test case that captures the mistake. A failing test case that ought to pass is the key to finding problems.