cs1705.tetris
Interface Brain
- All Known Implementing Classes:
- LameBrain
- public interface Brain
This interface defines the characteristics needed for a class to
be considered a Tetris "Brain" (an artificial tetris player).
- Version:
- 2003.10.13
- Author:
- Stephen Edwards (based on Nick Parlante's original)
|
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. |
bestMove
public 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.
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.
- Parameters:
board - the current state of the boardpiece - the piece that is fallingheightLimit - 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