#include "libepc.h" #include "tetris.h" /* ------------------------------------------------------------ */ /* Each tetris object is a 2x4 (rows x cols) array that can be */ /* rotated 0, 90, 180, or 270 degrees. This function returns */ /* TRUE if the specified cell of the array is filled or empty. */ /* ------------------------------------------------------------ */ BOOL On(int rot, int row, int col) { static char on[4][2][2] = { {{1,0},{1,1}}, {{1,1},{1,0}}, {{1,1},{0,1}}, {{0,1},{1,1}} } ; return on[rot][row][col/2] ; }