Tetris in the terminal, written in C.
A small, self-contained demo written in pure C — no external libraries, just the standard library and POSIX. Part of the Corg-Labs collection of single-file C programs.
- Seven tetromino shapes are stored as 4x4 rotation bitmasks
- Collision is checked against walls, floor and settled blocks
- A gravity tick drops the active piece on a timer
- Full rows are cleared and scored
gcc blocks.c -o blocks
./blocks
a/d move, w rotate, s soft-drop, space hard-drop, q quit.