DOC PREVIEW
UW CSE 341 - Study Guide

This preview shows page 1 out of 2 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CSE 341, Fall 2011, Assignment 6Due: Thursday December 1, 11:00PMCollaboration Rules: As usual, you can discuss high-level ideas with others but your work on the assign-ment should be your own. Because such a central part of the assignment is reading and understanding theprovided code, you should not discuss detailed questions about how particular lines of the provided code work.But it is fine to discuss Ruby language features and library methods that are used in the code in additionto high-level ideas about how the code works.Warning: Playing Tetris is fun, but playing too much can make the assignment take longer than necessary.Overview: The Ruby code provided to you in hw6provided.rb implements a simple but fully functioningTetris game (see, for example, http://www.tetris.com/how-to-play-tetris/). Evaluating the top-levelmethod runTetris starts a game. You are going to create a second game that is Tetris with some enhance-ments, described below. Evaluating the (provided) top-level method runMyTetris must run your game. Youshould not change any of the provided code, but you will use subclassing (since, after all, this is the OOPportion of the course) to nonetheless reuse as much of the code as possible. Some code-copying may benecessary, but you should minimize it subject to the no-changing-provided-code rule.Much of the work in this assignment is understanding the provided code. There are parts you will need tounderstand very well and other parts you will not need to understand. Part of the challenge is figuring outwhich parts are which. This experience is fairly realistic.Requirements:• You should not change any of the provided code, nor change the definitions of any of the classes definedin the provided code (e.g., do not add or replace methods in these classes). Instead, define new classes.• The provided Tetris game should work unchanged, with all of its features and none of the enhancements.• Your game should have all the original features work, as well as the enhancements.• Calling the provided top-level runMyTetris method must run your game.• For simplicity (though it does not really matter), add your code to the same file as the provided code.There is a section near the bottom with the comment, “Put your solution here.”Enhancements:1. In your game, the player can press the ’u’ key to make the piece that is falling rotate 180 degrees.(Note it is normal for this to make some pieces appear to move slightly.)2. In your game, instead of the pieces being randomly (and uniformly) chosen from the 7 classic pieces,the pieces are randomly (and uniformly) chosen from 10 pieces. They are the classic 7 and these 3:22222 22222 222The initial rotation for each piece is also chosen randomly.3. In your game, the player can press the ’c’ key to cheat: If the score is less than 100, nothing happens.Else the player loses 100 points (cheating costs you) and the next piece that appears will be:2The piece after is again chosen randomly from the 10 above (unless, of course, the player hits ’c’ whilethe “cheat piece” is falling).14. Challenge Problem: Add a fourth enhancement to your game that is interesting and not similar tothe enhancements already required. In a short text file, explain what your enhancement is and howyou implemented it. Enhancements that are particularly easy will not necessarily receive credit; aimfor something at least as substantial as the required enhancements and perhaps affecting a differentpart of the game.Do not share your enhancement with anyone unless they already have their own. We do not want tosee the same thing twice except by coincidence.Advice and Guidance:• It will take some time to understand the code you are given. Be patient and work methodically. Youmight try changing things to see what happens, but be sure you undo any changes you make to theprovided code.• The sample solution is about 75 lines of code. As always, that is just a rough guideline; your solutionmight be longer or shorter.• While you should not copy code unless necessary, it may be necessary. After all, the original gamemay not have functionality broken down into overridable methods the way you would want.Turn-in Instructions• Put your solutions in one file, lastname hw6.rb, which should include the provided code. You do notneed to turn in any other files unless you do the challenge problem, in which case you should havea second file lastname hw6 description.txt that is an English description of what you did for thechallenge problem (your code is still in the same file).• Turn in your files using the Catalyst dropbox link on the course


View Full Document

UW CSE 341 - Study Guide

Documents in this Course
Macros

Macros

6 pages

Macros

Macros

6 pages

Macros

Macros

3 pages

Mutation

Mutation

10 pages

Macros

Macros

17 pages

Racket

Racket

25 pages

Scheme

Scheme

9 pages

Macros

Macros

6 pages

Load more
Download Study Guide
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Study Guide and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Study Guide 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?