Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/t0xk/nc2048
A ncurses 2048 game that can be played in the terminal
https://github.com/t0xk/nc2048
2048 2048-clone 2048-game c cli curses curses-ui game ncurses terminal-game
Last synced: about 2 months ago
JSON representation
A ncurses 2048 game that can be played in the terminal
- Host: GitHub
- URL: https://github.com/t0xk/nc2048
- Owner: t0xk
- Created: 2023-04-03T15:26:12.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-04-12T20:46:53.000Z (about 1 year ago)
- Last Synced: 2024-01-27T11:01:41.672Z (5 months ago)
- Topics: 2048, 2048-clone, 2048-game, c, cli, curses, curses-ui, game, ncurses, terminal-game
- Language: C
- Homepage:
- Size: 68.4 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Lists
- cli-apps - nc2048 - A ncurses 2048 game that can be played in the terminal. (<a name="games"></a>Games)
- awesome-cli-apps - nc2048 - A ncurses 2048 game that can be played in the terminal. (<a name="games"></a>Games)
README
![]()
*ncurses 2048* or *nc2048* is a C implementation of the popular mobile game called '2048'. It is designed to be played
in a Terminal. The project was tested on Ubuntu 22.10 and Ubuntu for WSL2.> **NOTE:** This project was made to help the original creator learn about ncurses and the standard C99
> library. It might not fully follow the C99 guidelines and conventions.#### Prerequisites
* `cmake` version *3.10* or later,
* `ncruses` library, an installation guide is
available [here](https://www.cyberciti.biz/faq/linux-install-ncurses-library-headers-on-debian-ubuntu-centos-fedora/).#### Building the project
```shell
git clone https://github.com/t0xk/nc2048.git
cd nc2048
cmake -S . -B build
cd build
make# Run the project
./nc2048
```#### Proposed improvements
* The `populateRandomBlock` gets inefficient when the field fills up, since it re-generates a random x and y coordinate
for the block until it finds one that is empty. We plan to improve this in the future.
* The rendering and game logic should be executed on separate threads.#### Screenshots
![A screenshot of the nc2048 game](/res/screenshot.png)