15-112 Fall 2012 Optional Quiz C (Not Autograded)
50 Minutes


Read these instructions first!
  1. Tetris and Snake Pause [20 pts]
    In both Tetris and Snake, make it so that hitting 'p' toggles whether or not the game is paused.  When paused, no timerFired events are processed (though timerFired may still keep firing), but all keypresses are handled normally.  This makes it easier to debug and test the following two features...
     
  2. Tetris Toggle-Next-Piece [40 pts]
    In Tetris, make it so that hitting 't' toggles whether or not to show the next piece.  When toggled on, the next piece should be drawn to the side of the board, thus allowing for some planning by the player.  When toggled off, the next piece is not drawn to the side of the board.
     
  3. Snake Transpose [40 pts]
    In Snake, make it so that hitting 't' transposes the board, exchanging rows and columns (so the top row becomes the leftmost column and the bottom row becomes the rightmost column).  The snake head's location changes accordingly, so if it was at (r,c) it instead is at (c,r). However, the snake's direction is unchanged, so if it was heading left before the transpose, it is still heading left after the transpose.  You may assume the board is square.

carpe diem   -   carpe diem   -   carpe diem   -   carpe diem   -   carpe diem   -   carpe diem   -   carpe diem   -   carpe diem   -   carpe diem