CMU 15-112: Fundamentals of Programming and Computer Science
Homework 6 (Due Sat 26-Feb at 8pm ET)
Important notes:
- Collaborative:
- Tetris is meant to be entirely collaborative in groups of 2 or 3 current 15-112 lecture3 students.
- This must be earnest collaboration, with all 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 others to copy any portion of that work. All work must come from earnest collaboration from all of you.
- Be sure to list your partner's names and andrew ids at the top of your Tetris solution file.
- Solo:
- If you plan to work solo, which we do not recommend in any case, then you must obtain explicit permission via email from your recitation TA's before you start working on the assignment.
- Bonus:
- Tetris is a required exercise for this assignment. Every student must write Tetris.
- There are two fun ways for you to challenge yourself and earn bonus points on this assignment:
- Implement extra Tetris features (see details at the end of the Tetris instructions).
- Write bonus playSimplifiedChess (see the instructions below).
- Grace Days:
- Using a grace day only applies to you, not your partner.
- If you use a grace day, your partner may only continue to work with you after the Saturday 8pm deadline if they also use a grace day.
- In any case, if your partner attends the solution session, then they cannot discuss any part of this homework with you no matter how briefly.
- Finding partners:
- If you'd like our help finding a partner, fill out this form by Tuesday at 11:59pm ET.
- We'll match you with a classmate and send out partners by noon Wednesday.
- To start:
- Open the 'Tetris' exercise in CS Academy's 3.3.6 Section Exercises
- Write Tetris!
- Tetris [100 pts] [manually graded, collaborative]
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.
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! - Bonus playSimplifiedChess [10 stars, manually graded, solo]
First, carefully read about Simplified Chess here. Then, write an interactive game of simplified chess as described in part 1 of playChess here.
You should write your implementation in the "playSimplifiedChess" exercise in CS Academy's 3.3.6 Section Exercises.
Hint: Here's a Wikipedia page with a list of unicode chess pieces. You can call
drawLabel('♔', 200, 200, size=50, font='chess')
to draw a king on the canvas. Substitute other chess piece characters as you wish. And note the font!Implementing parts 2, 3, and 4 of playChess will earn you 2, 3, and 5 additional stars (on top of the 10 stars you earn for completing part 1). Though we hope you do this for the love of learning, and not for the (truly miniscule) grade boost!