Awesome
2048 Terminal Game
A simple implementation of the classic 2048 game in C made for GNU/Linux, designed to run in the terminal.
<p align="center"> <img src=".github/assets/gameplay.gif" width="350" alt="Gameplay Gif"> </p>Table of Contents
Features
- Classic 2048 gameplay in the terminal.
- Responsive arrow key controls.
- Score tracking.
- Ability to undo one move.
How to Play
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.
Requirements
- GNU Make
- C compiler (GCC or Clang)
Tested on: GNU/Linux, NixOs, Ubuntu, PopOs
Build and Run
- 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!
Install
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.
Uninstall
To uninstall the game, use the following command:
sudo make uninstall
This will remove the game executable form the INSTALL_DIR.
Credits
This project is inspired by and incorporates ideas from the following project:
License
This project is licensed under the MIT License - see the LICENSE file for details.