cs1705.tetris
Class LameBrain

java.lang.Object
  extended bycs1705.tetris.LameBrain
All Implemented Interfaces:
Brain

public class LameBrain
extends Object
implements Brain


Constructor Summary
LameBrain()
           
 
Method Summary
 void bestMove(Board board, Piece piece, int heightLimit, Move move)
          Given a piece and a board, generates a move object that represents the best play for that piece, or returns null if no play is possible.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LameBrain

public LameBrain()
Method Detail

bestMove

public void bestMove(Board board,
                     Piece piece,
                     int heightLimit,
                     Move move)
Description copied from interface: Brain
Given a piece and a board, generates a move object that represents the best play for that piece, or returns null if no play is possible. The board should be in the committed state when this is called. Note that moves have associated scores (completely determined by the brain), with lower scores meaning better moves.

Specified by:
bestMove in interface Brain
Parameters:
board - the current state of the board
piece - the piece that is falling
heightLimit - the max height of the bottom section of the board where pieces must come to rest--typically 20 cells (if pieces stack higher than this, the game is over)
move - Place the results in this object, which has already been allocated for you; the brain should assign values to all the fields appropriately to reflect the move it has chosen