Tetris is a game with little amount of basic physics principles that you should implement. You have to form a full line with the "tetrominos" that are "falling". These things, originally called "tetrominos", have 7 different shapes, from each there can be formed other 3 more shapes (by rotation). I use a 3x3 matrix to represent each "tetromino" and notate with 1 where i want to form a block.
I have written code in JavaScript and HTML5 to create this game from scrach.
I decided to integrate my code in a web page with a menu where you can find the categories: "How to play?" "History of the most simple game".