Problem Set 8

home work!

Programming Language ISL+

Purpose

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 258 from HtDP/2e (Hint: Read section 10.3 of the book for the last part.)

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

Problem 3 Exercise 277 from HtDP/2e

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

Since you have a new partner, note that you can now work from two independent code bases: your solution and his. Read them over, take the good ideas and drop the bad ones.

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.)