Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/samtay/tetris
A terminal interface for Tetris
https://github.com/samtay/tetris
brick game haskell terminal-game tetris tui vty
Last synced: about 21 hours ago
JSON representation
A terminal interface for Tetris
- Host: GitHub
- URL: https://github.com/samtay/tetris
- Owner: samtay
- License: other
- Created: 2017-06-13T03:48:49.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-12-07T18:03:19.000Z (14 days ago)
- Last Synced: 2024-12-13T15:16:39.554Z (8 days ago)
- Topics: brick, game, haskell, terminal-game, tetris, tui, vty
- Language: Haskell
- Homepage:
- Size: 406 KB
- Stars: 904
- Watchers: 15
- Forks: 41
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- starred - samtay/tetris - A terminal interface for Tetris (Haskell)
README
# tetris [![Build Status](https://github.com/samtay/tetris/actions/workflows/ci.yaml/badge.svg)](https://github.com/samtay/tetris/actions/workflows/ci.yaml)
A terminal interface for Tetris
![terminal-gif](./docs/img/play.gif)
## installation
Installation on MacOS and Linux is outlined below. Windows support is questionable, but you can try to install from [source](#install-from-source).#### MacOS
Installation on a Mac is simple with Homebrew:
```bash
brew install samtay/tui/tetris
```
#### Arch Linux
Arch Linux users can install from the [AUR](https://aur.archlinux.org/packages/tetris-terminal-git/), e.g.
```bash
yay -S tetris-terminal-git # or yaourt, etc.
```
#### Snapcraft
Thanks to **@thefenriswolf** this is available on most Linux distributions via [snapcraft](https://snapcraft.io/tetris-thefenriswolf):
```bash
sudo snap install tetris-thefenriswolf
alias tetris=/snap/bin/tetris-thefenriswolf.tetris # add to .bashrc or .zshrc etc.
```
#### install from source
First [get stack](https://docs.haskellstack.org/en/stable/README/#how-to-install). Then
```bash
git clone https://github.com/samtay/tetris.git
cd tetris
stack install tetris
```## usage
The default game is run by simply executing the `tetris` command.
If the unicode characters look a bit
wonky in your terminal, you can also run
```shell
tetris --ascii-only # uses [] as preview cell
# or
tetris --preview-chars 'XX' # uses custom characters as preview cell
```
If you want to skip the level prompt, you can start the game immediately via
```shell
tetris --level n
```
Lastly, to see the current high score, you can run `tetris --high-score`.
And of course, see `tetris --help` for help.## tips
#### troubleshooting
People seem to have varying levels of success with the linux binary. Please note that it is compiled dynamically and hence should not be expected to work on most distros. If you have other problems, feel free to open an issue.#### roll your own
If you like games in your terminal and have an interest in functional programming, write your own! This code is built on top of [brick](https://github.com/jtdaugherty/brick) which makes building terminal user interfaces very accessible. I also have a [tutorial](https://samtay.github.io/posts/introduction-to-brick) that can help you get started.