Home

Awesome

Build Alire Alire CI/CD Download Gitter chat Mentioned in Awesome Ada Screenshot of Play 2048!

This is yet another implementation of the 2048 game, implemented in Ada using ASFML for graphics and ada-toml for saving state.

It has been tested under Windows 10 and Ubuntu Linux 20.04.

Features

How to build

How to install

The game can be installed using Alire 2.0 with this command:

alr install

Refer to Alire documentation on how to add the Alire default installation to the PATH variable or how to change the default installation prefix.

If Alire 2.0 is not available, you can still install the application using something like this:

sudo make PREFIX=/opt/play_2048 install

If you're interested in building the AppImage file:

make AppImage

How to play

Use arrow keys to move tiles. When two adjacent tiles with the same number are merged, their numbers add up. Keep merging tiles until you get to 2048. If the board is full and there is no possible move (no adjacent tiles with the same number), you lose.

To change the board size, export the enviroment variable PLAY_2048_SIZE to the number of cells per size, for example, in Linux/Bash:

export PLAY_2048_SIZE=3

After a change in the board size, the board state will not be restored.

Keys:

Attribution

The initial implementation of the game logic was taken from Rosetta Code, although it has been mostly rewritten.

Fonts used in the themes: Noto Serif (SIL Open Font License) for Theme 5 and DeJa Vu Sans (MIT License) for the rest.