Or read through the source code in the banner image ... And speaking of Tetris without an OS, if you’ve got a comparatively spacious Arduino, you can get a version with all the frills.