Problem Set 8

home work!

Programming Language ISL+


image This problem set has two main goals: first, to practice the use of existing abstractions; second, to learn how to edit programs that you have already written, an essential skill for any programmer.

Problem 1 Exercise 217 from HtDP/2e

Problem 2 Exercise 225 from HtDP/2e

Problem 3 Exercise 234 from HtDP/2e (parts 1-5; you may ignore the "Demonstrate how to use these functions..." part.)

Problem 4 Edit your Tetris project once again. Be sure to fix any and all problems that your graders have (or would have) discovered.

Next, you are to use local and "loops" (abstractions such as map, foldr, filter, etc.) wherever your functions may benefit from them, especially for the lists of objects in your project. You may also use lambda terms in place of locally-named helper functions, if you wish.

You should notice that the length of your program decreases considerably.

Finally, give your program the missing feature that will make it a full Tetris game: whenever some row of the board is completely full of blocks, it should be deleted, and everything above shifted down one row.

Note: you should remove templates from your code before you hand it in. (Templates are handy for developing code, but do not need to appear in the final program.)