Terminal version of the game "2048" written in C++.
? Featured on GitHub's Twitter and Facebook pages! ?

The game and code is made to run natively on the GNU/Linux and MacOS platforms, but cross-platform compatibility for Windows has been added too.
g++, clang++, pgc++, icpc, etc.)git clone https://github.com/plibither8/2048.cppcd 2048.cppFor both CMake and Meson, the default C++ compiler on your system will be used.
If you wish to manually select a C++ compiler, optionally add CXX=clang++ cmake or CXX=clang++ meson etc.
ctest -S setup.cmakecmake --install build2048 # run `build/2048` if game is not installedOR
meson buildmeson test -C buildmeson configure build --prefix=$HOME/.local
meson install -C build2048 # run `build/2048` if game is not installedFirst of all, thank you for contributing ?! A few things to note:
If you have found a bug, or have a feature that you'd like implemented, raise an issue.
If you have proposed a pull request, make sure that you run clang-format on the source code (both, .cpp and .hpp) files if you've made changes there.
In your local repository, run git update-index --skip-worktree ./data/*.txt to ensure that changes to the data files are not tracked by git, and thus are not staged.
I deeply appreciate the help of the following people:
cstdlib rand to C++ random int generator.CMakeLists.txt file.1 to be printed.clang-format.Game class constructor.CMakeLists.txt file and made Color enum to a scoped enum.consts.[GameBoard].getTile(2,0) refers to the 0th tile (or column) in 2nd row as in this case, x = 0 and y = 2. The specific tile is denoted the by '@' symbol in the following gameboard:
Note:
rowandcolumnindexing starts at 0.
┌──────┬──────┬──────┬──────┐
│ │ │ │ │
├──────┼──────┼──────┼──────┤
│ │ │ │ │
├──────┼──────┼──────┼──────┤
│ @ │ │ │ │
├──────┼──────┼──────┼──────┤
│ │ │ │ │
└──────┴──────┴──────┴──────┘
Copyright (c) Mihir Chaturvedi. All rights reserved.
Licensed under the MIT License.