Giter Club home page Giter Club logo

tetris's Introduction

tetris Build Status

A terminal interface for Tetris

terminal-gif

installation

For MacOS, the binary attached to the GitHub release should suffice. Arch Linux users can install from AUR. If you are on Debian or similar distros, you can try the Linux binary as well but no guarantees. See the other two options, installing from source and dex.

github release binaries

Here is a quick way to get the one for your OS:

curl -L https://github.com/samtay/tetris/releases/download/0.1.4/tetris-`uname -s`-`uname -m` -o tetris
chmod +x tetris
sudo mv tetris /usr/local/bin/

install on Arch Linux

However you typically install from the AUR, e.g.

yaourt -S tetris-terminal-git

install from source

First get stack. Then

git clone https://github.com/samtay/tetris.git
cd tetris
stack install tetris

install via dex

dex is a really cool application manager that lets you run executables as docker images, so that you don't need to worry about installing them or their dependencies directly.

# get dex if you don't have it
curl -L http://get.iceburg.net/dex/latest-0.12.x/dex -o dex
chmod +x dex
sudo mv dex /usr/local/bin

# add tetris as a repo
dex repo add tetris https://github.com/samtay/tetris.git

# run tetris
dex run tetris

### optionally install tetris globally ###
export PATH="$HOME/.dex/bin:$PATH"
dex install --global tetris
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.

tetris's People

Contributors

samtay avatar jose1711 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.