Problem Set 7

home work!

Programming Language ISL+

Purpose This problem set concerns the use of existing abstractions and tree-shaped data.

Finger Exercises HtDP/2e: 232, 233, 234; 251, 253 256, 259

image

Problem 1 Use the capabilities of ISL+ to “edit” your implementation of the HungryHenry game:
  • Use existing abstract list processing functions where possible.

  • Use local to express function bodies where it helps clarify intent.

  • Abstract over common patterns if there are any. If you can imagine revised data definitions that enable such abstractions, feel free to revise your project.

As you edit, make sure that the program continues to pass its test cases.

Problem 2 Exercise 235 from HtDP/2e

Problem 3 Exercise 243 from HtDP/2e

Problem 4 Exercise 252 from HtDP/2e

Problem 5 Exercise 257 from HtDP/2e

Problem 6 Here is a structure type definition and its associated data definition:
(define-struct result (name score))
; Result is (make-result String Number).

Design update. The function consumes a Result r and a list of Results. It constructs a Result list from the latter by replacing all Results with the same name field as r with r itself. Otherwise the given list remains the same.