simple tetris script

well if it is 1 dot tetris you will really only need two buttons, right and left because rotation of a single pixel is irrelevant

there is some sample code here,on a tetris engine... I havent read it, but google can be your fiend for things like this.
http://www.mit.edu/people/nathanw/java/TetrisSrc.html

It is really just the simplest form of collision detection.