A simple implementation of the classic 2048 game in C made for GNU/Linux, designed to run in the terminal.
- Classic 2048 gameplay in the terminal.
- Responsive arrow key controls.
- Score tracking.
- Ability to undo one move.
The goal of the game is to combine number tiles by moving them in different directions using arrow keys, with the objective of reaching the tile with the value of 2048. When two tiles with the same value collide during a move, they merge into a new tile with the sum of their values. After each move, a new tile (either 2 or 4) will appear in an empty spot on the board. The game continues until there are no empty spots left on the board, and the player can no longer make valid moves, resulting in the game coming to an end.
- GNU Make
- C compiler (GCC or Clang)
Tested on: GNU/Linux, NixOs, Ubuntu, PopOs
- Clone the repository:
- Navigate to the project directory:
git clone https://github.com/Frost-Phoenix/2048-cli.git cd 2048-cli
- Build then run the game:
make ./bin/2048
-
Or build and run with:
make run
- Use arrow keys to play, and enjoy the game!
To install the game and make it available system-wide, use the following commands:
sudo make install
The game will be installed in the default location (/usr/local/bin). If you wish to install it in a different location, modify the INSTALL_DIR variable in the Makefile before running the install command.
To uninstall the game, use the following command:
sudo make uninstall
This will remove the game executable form the INSTALL_DIR.
This project is inspired by and incorporates ideas from the following project:
This project is licensed under the MIT License - see the LICENSE file for details.