Console version of the game "2048" for GNU/Linux written in C++.
Ability to save scores, choose board size and view statistics!
- Add start menu [19/04/2018]
- Save highscore / score [21/04/2018]
-
Save a game state and play from a saved game state(Abandoned indefinitely) -
AI(Abandoned indefinitely)
The game and code is natively made to run on the GNU/Linux platform, but cross-platform compatibility for Windows has been added too.
- g++ or gcc compiler
- Linux, macOS OR Windows with a working terminal (Cygwin or Git bash is recommended for Windows)
- Open your terminal in your preferred directory and clone this project:
$ git clone https://github.com/plibither8/2048.cpp
- Enter the project directory:
$ cd 2048.cpp
- Create a
build
folder (Optional):
$ mkdir build
- Compile the
2048.cpp
file and create an output using the Makefile:
$ make
- Run the program and play the game!
$ ./build/2048.out
- Game board array is defined as
board[y][x]
- Game board will follow the following structure:
'x' => x-axis OR the horizotal line OR rows
'y' => y-axis OR the vertical line OR columns
board[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:
+------+------+------+------+
| | | | |
+------+------+------+------+
| | | | |
+------+------+------+------+
| @ | | | |
+------+------+------+------+
| | | | |
+------+------+------+------+
Copyright (c) Mihir Chaturvedi. All rights reserved.
Licensed under the MIT License.