Tetris clone TUI for the terminal. Written in pure C with no external libraries, rendering is raw ANSI escape sequences, raw-mode input with alt-screen, pthreads for the game loop, and no memory allocations.
![]() | ![]() |
make run # build and run
| Key | Action |
|---|---|
| Up / Down | Navigate the menu |
| Enter | Select menu item |
| Left / Right | Move piece left / right |
| Down | Move piece down |
| R or Space | Rotate clockwise |
| P | Pause / resume |
| H | Show help |
| Q | Quit to menu |
100 * level * lines * lines for clearing lines.1 + lines cleared / 10. Every 10 lines, level up.main.c menu loop and entry point
inc/ headers
board.h board grid
color.h colors
game.h game loop
help.h help screen
input.h key events
menu.h main menu
state.h game stats
tetromino.h pieces
ui.h game screen drawing
ui_assets.h constanta for ui
tdraw.h header-only terminal drawing helpers
src/ implementations
MIT. See LICENSE.
59 commits
C
98.8%
Makefile
1.2%
Tetris clone TUI for the terminal. Written in pure C with no external libraries, rendering is raw ANSI escape sequences, raw-mode input with alt-screen, pthreads for the game loop, and no memory allocations.
![]() | ![]() |
make run # build and run
| Key | Action |
|---|---|
| Up / Down | Navigate the menu |
| Enter | Select menu item |
| Left / Right | Move piece left / right |
| Down | Move piece down |
| R or Space | Rotate clockwise |
| P | Pause / resume |
| H | Show help |
| Q | Quit to menu |
100 * level * lines * lines for clearing lines.1 + lines cleared / 10. Every 10 lines, level up.main.c menu loop and entry point
inc/ headers
board.h board grid
color.h colors
game.h game loop
help.h help screen
input.h key events
menu.h main menu
state.h game stats
tetromino.h pieces
ui.h game screen drawing
ui_assets.h constanta for ui
tdraw.h header-only terminal drawing helpers
src/ implementations
MIT. See LICENSE.
59 commits
C
98.8%
Makefile
1.2%