Teaching
211 F '07
 
Assignments
The Hand In
The Recipes
The World
Set 1
Set 2
Set 3
Set 4
Set 5
Set 6
Set 7
Set 8
Set 9
Set 10
Set X1

Problem Set 10

Due date: 11/26 @ 6pm

Programming Language: Intermediate Student Language with lambda


The goal of this problem set is to practice the use of existing abstractions, and how to extend programs you have already written.


HtDP Problems:

21.2.1, 21.2.2, 21.2.3

Problem A1:

Edit your Tetris project once again. Be sure to fix any and all problems that your graders have discovered.

Next, you are to use "loops" wherever your functions may benefit from them, especially for the lists of objects in your project.

Extend your program to "full" tetris, that is, whenever a tetra lands, any full rows should be eliminated and all blocks above that row should be moved down one unit.

Problem A2:

Develop data definitions for binary trees of symbols and binary trees of numbers. Numbers and symbols should occur at the leaf positions only. Create two instances of each. Abstract over the data definitions.

Design the function height, which consumes any binary tree and computes its height, that is, how far it is from the root (the given tree) to farthest leaf.

A leafy binary tree is a binary tree with 'leaf at its leafs.

Design a function that consumes a natural number n and creates all leafy binary trees of height n.

Hint:
Design a function that consumes a natural number n and creates all leafy binary trees of height equal or less than n? -- Warning: this is not about abstraction; it's just a reminder that regular (and complex) programs are around the corner.


last updated on Mon Nov 19 01:21:50 EST 2007generated with PLT Scheme