Git Product home page Git Product logo

2048-cli's Introduction

#2048-cli

A cli version/engine of the game 2048 for your Linux terminal.

Screenshot

There currently are 3 versions that can be run. These include a straight-forward terminal based, and two using the ncurses and SDL libraries. To add a new graphical version, simply create a .c file which implements all the functions in gfx.h and add a Makefile entry.

Get

git clone https://github.com/Tiehuis/2048-cli.git
make

By default, termios.h is expected to be present for the standard terminal version, and a VT100 compatible terminal is being used. If a VT100 terminal is not available, simply alter the makefile and remove the '-DVT100' flag. Compiling with ncurses requires the development libraries for it, and likewise for using SDL2.

On an ubuntu/debian machine for example, these can be obtained via

apt-get install libncurses5-dev
apt-get install libsdl2-dev libsdl2-ttf-dev

Note: The sdl version is largely to demonstrate plugging in an alternative graphics frontend, and is likely not wanted. The ncurses version is recommended.

You can also also easily install this on el >= 5 (CentOS, RedHat Enterprise Linux, Scientific Linux, Oracle) and Fedora >= 19 using the package-manager:

sudo yum install 2048-cli[-nocurses]

For el you will need to have the EPEL-repository enabled.

Controls

hjkl and wasd  Default movement keys
q              Quit the current game

Options

-h             Print the program usage.
-H             Print the current highscore.
-C             Disable color support (default).
-c             Enable color support if supported.
-a             Enable animations (default).
-A             Disable animations.
-i             Enable ai without displaying game.
-I             Enable ai and display game.
-r             Reset highscore. Will prompt user.
-s SIZE        Set the size of the playing field.
-b RATE        Set the rate at which blocks spawn per turn.

Fonts used in SDL version can be found here.

License

This code is licensed under the MIT License.

2048-cli's People

Contributors

amdmi3 avatar arbu avatar besser82 avatar christopherraa avatar fe051 avatar tiehuis avatar

Watchers

 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.