Generalized Tetris in C