Tetris AI algorithm in C