Homework 6 (Due Saturday 8-Oct at 8pm)


Important notes:
  1. Read the "Important Notes" at the top of hw1. The same general rules apply to all homework unless otherwise specified.
  2. This homework is solo. You must not collaborate with anyone (besides current course TA's and faculty) in any way. See the syllabus for more details.
  3. You will need these starter files:
    1. hw6.py
    2. cmu_112_graphics.py
    3. cs112_f22_week6_linter.py
  4. Edit hw6.py
  5. When you have completed and fully tested hw6, submit hw6.py to Autolab. For this hw, you may submit up to 5 times, but only your last submission counts.

  6. Do not use recursion this week, or any imports/data structures we have not yet covered.
  7. This assignment is entirely manually graded! So:
    • After submitting to Autolab, you should download your file and make sure it is what you intended to submit! It is your responsibility to submit your work correctly, so please don't get a zero because you uploaded a blank file and didn't check.
    • It is your responsibility to read the writeup carefully so that you know what we expect. Ask questions if you aren't sure!
    • You may wish to write some of your own test cases for certain functions. This is a good idea and we encourage it.

Note: Remember that midterm1 is coming up! We recommend spending some time studying this week. The most effective way to study is to write code, so do some practice problems from the website, re-take some of your old quizzes, and try some previous midterms from earlier versions of the course.

  1. Tetris [100 pts] [manually graded]
    Reminder: This assignment is SOLO.

    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.

    That being said, treat the colors as suggestions. If you want to use different colors from the writeup, as long as the game is still legible and playable, that's fine :)

    Caution: Writing your code with good style is critical to your success on this assignment! If your code is disorganized and if you aren't testing your features as you build them in, you will not finish this.

    To get full credit, you'll need to complete the basic implementation according to the design spec.

    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.

    Have fun!