Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A wicked fast 2048 game engine with AI
C C++
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


c2048 is a 2048 game engine with AI, made in C.

c2048 uses bitmaps extensively, and should have a very fast board implementation. The AI is a simple depth-first search using score + number_or_free_cells as a heuristic.

If you want to change the parameters for the search algorithm, change AI_DEPTH and AI_NUM_TRIES in ai.h.

Shell arguments:

--human  Play on the console, using hjkl to move around
--test   Runs some testcases
--ai     Runs infinitly many games in a row, while tracking stats (avg, max, nps, etc.)

If you run it with no arguments, it will be able to talk to 4096, a 2048 bot interface made by Mats Lindh:

../4096/4096/ 0 ./2048
Something went wrong with that request. Please try again.