I remember playing Paper Tetris with a friend at uni about 11 years ago now. I made a single player version in Flash at the time. I was quite proud of the algorithm to determine if a piece can be drawn in place as it's a bit different than normal Tetris rules.
Here it is: http://speps.github.io/papertetris/ (Flash player required, lost source code)