15-110 Sections G-J / Spring 2010 / Quiz 8
3 Questions / 20 Minutes
 

1)      Write the placeFood method from our Snake implementation.  You may use the instance variables board and random.
 

2)      Our Connect4 implementation had 3 versions of contains4:  an outer one, that took no parameters, a middle one that took the starting location of the run, and an inner one that took both the starting location and the direction of the run.  Write the middle version of contains4.  You may assume the other two versions are written correctly.  You may use the instance variables winningLength, board, and currentPlayer.
 

3)      Write the fallingPieceIsLegal method from our Tetris implementation.  You may use the instance variables fallingPiece, fallingPieceRow, fallingPieceCol, board, and emptyColor.
 

4)      2 points bonus:  Write a nice poem about programming and/or computer science.