https://github.com/garlinhs/game-2048
Terminal version of the game "2048" written in C++.
https://github.com/garlinhs/game-2048
2048 c-plus-plus cmake cross-platform game meson
Last synced: about 1 month ago
JSON representation
Terminal version of the game "2048" written in C++.
- Host: GitHub
- URL: https://github.com/garlinhs/game-2048
- Owner: garlinhs
- License: mit
- Created: 2024-03-15T06:21:14.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-04T05:53:55.000Z (about 1 year ago)
- Last Synced: 2025-02-28T07:34:22.767Z (about 2 months ago)
- Topics: 2048, c-plus-plus, cmake, cross-platform, game, meson
- Language: C++
- Homepage:
- Size: 3.94 MB
- Stars: 4
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# game-2048
[](https://github.com/garlinhs/game-2048/actions/workflows/ci.yml)
[](https://repl.it/github/garlinhs/game-2048)> Terminal version of the game "2048" written in C++.
![]()
## 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](https://cmake.org/) or [Meson](https://mesonbuild.com/)### Installation
1. Open your terminal in your preferred directory and clone this project:
```sh
git clone https://github.com/garlinhs/game-2048
```
2. Enter the project directory:
```sh
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
3. Build the executable and run tests
```sh
ctest -S setup.cmake
```
4. Install the program (optional)
```sh
cmake --install build
```5. Run the program and play the game! :tada:
```sh
2048 # run `build/2048` if game is not installed
```
OR#### Building with Meson
3. Generate build configuration
```sh
meson build
```
4. Build the executable and run tests
```sh
meson test -C build
```
5. Install the program (optional)
```sh
meson configure build --prefix=$HOME/.local
meson install -C build
```6. Run the program and play the game! :tada:
```sh
2048 # run `build/2048` if game is not installed
```## Contributing
First of all, thank you for contributing :smile:! A few things to note:
* If you have found a bug, or have a feature that you'd like implemented, [raise an issue](https://github.com/garlinhs/game-2048/issues).
* 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
* [Garlinh Soler](https://github.com/garlinhs)
---
## License
Copyright (c) Garlinh Soler. All rights reserved.
Licensed under the [MIT](LICENSE) License.