|
You should print out your solutions to this assignment, and either turn them in at lecture, or leave them in the TA's mailbox at Sudikoff by class time on Fri. Feb. 27, 2009.
Please also e-mail an electronic version of your code to cs8hw@cs.dartmouth.edu, with the subject "CS 8 Short Assignment 9". Please attach your code as one or more enclosures to the message, and do not include it directly in the body of the e-mail message.
You must work alone on this short assignment.
This assignment asks you to extend TetrisFramework.hs, which we saw in class. It drops an Ellipse. You are to change it so that it creates several Tetris pieces out of rectangles using the Region constructors, picks one at random, and drops it. The rotations should be done via the RotateL constructor in RegionsEX. I suggest constructing the "T" and both "L"s. These all can be made from a 1 x 3 rectangle and a 1 x 1 rectangle. However, the eventual Tetris program will need shapes whose basic components are 1 x 1 rectangles. Therefore instead of creating a single 1 x 3 rectangle, create it as a Region by unioning translated versions of a 1 x 1 rectangle. Then complete the three shapes by unioning this 1 x 3 bar with a 1 x 1 rectangle translated to each of the appropriate places.
The code that you need for this assignment is:
Hand in a listing of your modifed TetrisFramework.hs and screen shots showing at least one of your pieces dropping.