A terminal interface for Tetris
A terminal interface for Tetris
Installation on MacOS and Linux is outlined below. Windows support is questionable, but you can try to install from source.
Installation on a Mac is simple with Homebrew:
bash brew install samtay/tui/tetris
Arch Linux users can install from the AUR, e.g.
bash yay -S tetris-terminal-git # or yaourt, etc.
Thanks to @thefenriswolf this is available on most Linux distributions via snapcraft:
bash sudo snap install tetris-thefenriswolf alias tetris=/snap/bin/tetris-thefenriswolf.tetris # add to .bashrc or .zshrc etc.
First get stack. Then
bash git clone https://github.com/samtay/tetris.git cd tetris stack install tetris
The default game is run by simply executing the
tetriscommand. If the unicode characters look a bit wonky in your terminal, you can also run ```shell tetris --ascii-only # uses [] as preview cell
tetris --preview-chars 'XX' # uses custom characters as preview cell
If you want to skip the level prompt, you can start the game immediately viashell tetris --level n ``
Lastly, to see the current high score, you can runtetris --high-score
. And of course, seetetris --help` for help.
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.
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 which makes building terminal user interfaces very accessible. I also have a tutorial that can help you get started.