CMU 15-112: Fundamentals of Programming and Computer Science
Homework 9 (Due Wednesday 28-Jul at 5pm)
- This homework is collaborative. See the collaboration rules below, and see the syllabus for more details.
Here are the rules for collaboration:
- Everyone must read all of these rules, even if you opt out of collaborating.
- Collaboration is optional.
- Collaboration is in groups of 2-3, arranged by your TA.
- If you do collaborate, you must arrange this with your TA from your recitation, who must know which students in the recitation are collaborating with which other students.
- You may only collaborate with other students in your recitation.
- You may not change your collaborators once you have chosen them (except with written permission from Mike or Sara if your partner becomes nonresponsive).
- You must list the andrew id's of your collaborators in a comment just above your solutions to this section.
- You must be an effective collaborator, working together as much as possible.
- It is strictly forbidden for you to simply copy the code of your collaborators. That is not collaborating, that is cheating. Instead, you must type all your own code, without copying from others. You can discuss all parts of the problem with your collaborators. They can even help you debug. But still, you must write your own code.
- Reminder from the syllabus: when we say "do not copy" we always mean visually, verbally, electronically, or in any other way, even if you copy and modify it.
- Create a folder named 'hw9'
- Download these files into that folder:
- Edit hw9.py using VSCode
- When you have completed and fully tested hw9, submit hw9.py to Autolab. You may submit up to 5 times and, as usual, only your last submission counts.
- There is no autograder for hw9. The TA's will manually grade your last submission sometime soon after the hw deadline.
- Tetris [100 pts] [manually graded]
Reminder: Any collaboration must be earnest collaboration, and you must list your collaborators. If you submit code that you are unable to thoroughly explain, or if you could not rewrite Tetris from scratch without referencing your submission, you have not collaborated well.
With 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. This is also meant to keep you from hitting a dead-end with a less-thought-out algorithmic plan. If you wish to customize your implementation, see the note on bonus features below.
To get full credit, you'll need to complete the basic implementation according to the design spec (up to and including step 7).
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.