Skip to content
/ nc2048 Public

A ncurses 2048 game that can be played in the terminal

Notifications You must be signed in to change notification settings

t0xk/nc2048

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Building the project

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

Releases

No releases published

Packages

No packages published