An open API service indexing awesome lists of open source software.

https://github.com/domin-mnd/tetris

đŸ•šī¸ Terminal-based tetris written in C.
https://github.com/domin-mnd/tetris

c ncurses tetris

Last synced: over 1 year ago
JSON representation

đŸ•šī¸ Terminal-based tetris written in C.

Awesome Lists containing this project

README

          


Tetris

# Tetris!

This is a small implementation of terminal-based tetris game written in C using ncurses.h library.

# Controls

The controls are typical of Tetris:

- ← & → - moves the tetromino horizontally;
- ↑ - rotate the tetromino;
- ↓ - fast drop tetromino;
- Space - immediately drop tetromino;
- Q - exit the game, without saving the score;
- P - pause the game (press again to resume).

# Installation

> [!NOTE]
> Executables, compiled using [GitHub Actions](./.github/workflows/build-release.yml) are accessible via [Releases](https://github.com/domin-mnd/tetris/releases) tab.

If you want to compile the project using source code, here are following prerequisites required:

- ncurses: `pacman -S ncurses` / `apt install libncurses-dev`
- just: `pacman -S just` / `apt install just`

To compile the project run `just install`, it would compile the project and output `tetris` file:

```sh
$ just install
gcc -Wall -Wextra -Werror -std=c2x -O3 -Isrc/include src/tetris.c src/main.c -o tetris -lncurses
$ ./tetris
```

# Credits

This tetris implementation is MIT licensed 💖