Terminal version of the game "2048" written in C++.
- 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)
The game and code is natively made to run on the GNU/Linux and MacOS platforms, but cross-platform compatibility for Windows has been added too.
- C++ compiler (e.g.
- Linux, MacOS OR Windows with a working terminal (Cygwin, Windows Subsystem for Linux 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
- Compile the
2048.cppfile and create an output using the Makefile:
- Run the program and play the game!
- Game board array is defined as
- Game board will follow the following structure:
'x' => x-axis OR the horizontal line OR columns 'y' => y-axis OR the vertical line OR rows
For example (zero-indexed)
board 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.