返回排行榜

samtay/tetris

Haskell

A terminal interface for Tetris

haskellbrickvtyterminal-gametetrisgametui
Star 增长趋势
Star
1k
Forks
43
周增长
Issues
11
5001k
2023年1月2024年3月2025年5月2026年7月
README

tetris Build Status

A terminal interface for Tetris

terminal-gif

installation

Installation on MacOS and Linux is outlined below. Windows support is questionable, but you can try to install from source.

MacOS

Installation on a Mac is simple with Homebrew:

brew install samtay/tui/tetris

Arch Linux

Arch Linux users can install from the AUR, e.g.

yay -S tetris-terminal-git # or yaourt, etc.

Snapcraft

Thanks to @thefenriswolf this is available on most Linux distributions via snapcraft:

sudo snap install tetris-thefenriswolf
alias tetris=/snap/bin/tetris-thefenriswolf.tetris # add to .bashrc or .zshrc etc.

install from source

First get stack. Then

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

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

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 which makes building terminal user interfaces very accessible. I also have a tutorial that can help you get started.

相关仓库
jgm/pandoc

Universal markup converter

HaskellGNU General Public License v2.0pandochaskell
pandoc.org
45.5k3.9k
koalaman/shellcheck

ShellCheck, a static analysis tool for shell scripts

HaskellGNU General Public License v3.0haskellshell
shellcheck.net
39.7k1.9k
hasura/graphql-engine

Blazing fast, instant realtime GraphQL APIs on all your data with fine grained access control, also trigger webhooks on database events.

TypeScriptnpmApache License 2.0graphqlgraphql-server
hasura.io
32k2.9k
PostgREST/postgrest

REST API for any Postgres database

HaskellMIT Licensehaskelldatabase
postgrest.org
27.5k1.2k
compiler-explorer/compiler-explorer

Run compilers interactively from your web browser and interact with the assembly

TypeScriptnpmBSD 2-Clause "Simplified" Licenserustc-plus-plus
godbolt.org
18.9k2.1k
simplex-chat/simplex-chat

SimpleX - the first messaging network operating without user identifiers of any kind - 100% private by design! iOS, Android and desktop apps 📱!

HaskellGNU Affero General Public License v3.0chatprotocol
simplex.chat
18.9k1.2k
hadolint/hadolint

Dockerfile linter, validate inline bash, written in Haskell

HaskellGNU General Public License v3.0dockerfilelinter
12.3k498
hmemcpy/milewski-ctfp-pdf

Bartosz Milewski's 'Category Theory for Programmers' unofficial PDF and LaTeX source

TeXOtherhaskellcategory-theory
bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/
11.7k645
lk-geimfari/awesomo

Cool open source projects. Choose your project and get involved in Open Source development now.

GoGo ModulesCreative Commons Zero v1.0 Universalawesomeocaml
9.9k690
purescript/purescript

A strongly-typed language that compiles to JavaScript

HaskellOtherhaskellpurescript
purescript.org
8.9k571
unisonweb/unison

A friendly programming language from the future

HaskellOtherhaskellprogramming-language
unison-lang.org
6.7k305
liuxinyu95/AlgoXY

Book of Elementary Functional Algorithms and Data structures

TeXalgorithmshaskell
6.3k764