Skip to content

Terminal version of the game "2048" written in C++.

License

Notifications You must be signed in to change notification settings

garlinhs/game-2048

Repository files navigation

game-2048

Actions Status Run on Repl.it

Terminal version of the game "2048" written in C++.

2048 in action!

Setup

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.

Requirements

  • C++11 compiler (e.g. g++, clang++, pgc++, icpc, etc.)
  • Virtually any platform including:
    • Linux
    • MacOS
    • Windows (via Cygwin or Windows Subsystem for Linux)
  • CMake or Meson

Installation

  1. Open your terminal in your preferred directory and clone this project:
git clone https://github.com/garlinhs/game-2048
  1. Enter the project directory:
cd game-2048

For 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.

Building with CMake

  1. Build the executable and run tests
ctest -S setup.cmake
  1. Install the program (optional)
cmake --install build
  1. Run the program and play the game! 🎉
2048    # run `build/2048` if game is not installed

OR

Building with Meson

  1. Generate build configuration
meson build
  1. Build the executable and run tests
meson test -C build
  1. Install the program (optional)
meson configure build --prefix=$HOME/.local
meson install -C build
  1. Run the program and play the game! 🎉
2048    # run `build/2048` if game is not installed

Contributing

First 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.

Maintainers


License

Copyright (c) Garlinh Soler. All rights reserved.

Licensed under the MIT License.

About

Terminal version of the game "2048" written in C++.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published