Jane Street interview question

Implement some basic Tetris functions.