C++ Tetris game using the X Window System.
Heavy emphasis on design and design patterns:
For example, the model-view-controller pattern was used to decouple the logic of receiving user commands to move the block, from the logic of the block movement itself, that is, moving around the playing grid, checking for collisions, a full row, etc. (See BlockController and Block below; look near the top).
Another example, the observer pattern was used to pass information along the playing field. The field was divided into a grid of cells, each of which would subscribe to events from its adjacent cells. When a block is dropped, each cell in the dropped block would notify its neighboring cells that the grid cell it's currently occupying is no longer empty. Its neighbouring cells would then notify their neighbours, and so on. By passing information like this, events such as detecting a full row for deletion was made possible. (See Grid, Cell, Subject and Observer below; look left).
Controlled via standard input: "right", "left", "drop", etc.
Features multiple levels and block types, as well as a text and graphical display.