A simple Tetris clone written in C using the ncurses library that feels better than other terminal Tetris games I've tried.
| Key | Action |
|---|---|
| ↑ | Rotate piece |
| ← / → | Move left / right |
| ↓ | Soft drop (move down) |
| Space | Hard drop |
| C | Hold / switch piece |
| Esc | Pause |
| R | Restart |
You need:
- A C compiler (GCC or Clang)
- The
ncursesdevelopment headers
Debian / Ubuntu:
sudo apt install gcc make libncurses5-dev libncursesw5-devArch Linux:
sudo pacman -S base-devel ncursesFedora:
sudo dnf install gcc make ncurses-develVoid Linux:
sudo xbps-install -S base-devel ncursesClone the repo and run:
Clone and build:
git clone https://github.com/LowLevelLoser/ncurses_tetris
cd ncurses_tetris
makeThis builds the executable tetris.
To install globally (into /usr/local/bin/tetris):
sudo make installTo uninstall:
sudo make uninstallYou can change the prefix if you don’t want to install into /usr/local:
make PREFIX=$HOME/.local installThis will place tetris in ~/.local/bin.
If installed system-wide:
tetrisIf running directly from the repo:
./tetris