Tetris is liked to be cloned and imitated, and not least because it is so "simple". The programming, however, is perhaps not as trivial as one might think ... depending on how you implement it. I'd like to share my version, I made with GameMaker: Studio (version 1.4.1657) and explain a little bit to it:
In this repository you will find the entire project, including all images and code. Overall the game is not necessarily written beginner friendly - we want see how it's done "correctly" for learning, and let's see how it looks like. That is, the code is partly highly optimized and no unnecessary Drag'n'Drop was used. Nevertheless, I have the scripts clearly structured and extensively commented (in English).
For more information and explanations se the post on my Game Dev Blog:
(Here you can also see some of the used code.)