CMU 15-112: Fundamentals of Programming and Computer Science
Homework 7 (Due Saturday 12-Oct at 8pm): Tetris!
- Unlike all other homeworks, this homework is collaborative in
teams of two (yourself and one other current 15-112 student).
- Collaboration is not strictly required, but is very strongly encouraged.
- You may only work with at most one other student (and they must be
currently in 15-112), and you may not switch partners once you have
worked with a partner.
- This must be earnest collaboration, with both of you genuinely working together
the whole time. It is not acceptable for one of you to do the work, or any portion of the work, and for the other to copy any portion of that work.
All work must come from earnest collaboration from both of you.
- If you need help finding a partner, the Head TA's will post a form to piazza
that you can fill out and we will try to help. We will stop monitoring
that form at 8pm on Friday.
- Helpful forms
Note: you must be authenticated to andrew.cmu.edu for these to work:
- To start:
- Create a folder named 'week7'
- Download all of these to that folder:
- Edit hw7.py
- Even if you are working with a partner, each of you must type
your own hw7.py, and each of you must submit your own hw7.py
to Autolab.
- When you have completed and fully tested hw7, submit hw7.py to Autolab. For this hw, you may submit up to 5 times,
but only your last submission counts.
- Do not use recursion this week.
- Do not hardcode the test cases in your solutions.
- Even though we have split writing-sessions into their own separate
category, homeworks will continue to be out of 75 points instead of
100 points so that each hw is equally weighted.
- Collaborative: Tetris [75 pts] [manually graded]
Reminder: This must be earnest collaboration. You may not copy any code from your collaborator (or anyone else) by any means (electronically, on paper, by sight, etc).
All work must be done truly in collaboration, working together, not copying.
With this kind of positive collaboration in mind, write Tetris according to the design given in this step-by-step tutorial. You may not use a different design, even if you think there's a better way to do it (there probably is, but you still have to do it this way). This may seem limiting, but sometimes you have to write code according to a specific algorithm, rather than writing code to solve a specific problem.
To get full credit, you'll need to complete the basic implementation according to the design spec,
and also complete the first suggested extra feature (hard drop). So hard drop
is required, and not for bonus.
If you decide to add some more bonus, which we do not require
but we heartily encourage (not for the few
points you might earn, but rather for the joy of learning and creating), then:
- Have the code run normally, without any bonus features, so the TA's
can easily grade your submission against the spec.
- But if the user presses 'b', then the game switches to bonus
mode, and the bonus features are activated.
- When the user presses 'b' to activate the bonus features, a description
of all the bonus features is printed to the console. Be sure
to print enough of an explanation that the TA's can understand
how to use and grade your bonus features.
Note: While you may submit to Autolab up to 5 times for this assignment, there is no autograded portion for hw7.py, so you will be responsible for testing your code and making sure it meets the problem requirements. As stated in the style guide, you do not have to write test cases for interactive, random, graphics, data initialization or event functions. Instead, you should test by visually inspecting your code's behavior as you complete steps of each problem, where reasonably possible. This will make debugging your code much easier!