plibither8 / 2048.cpp
- вторник, 4 сентября 2018 г. в 00:15:24
C++
🎮 Terminal version of the game "2048" written in C++ 11
Terminal version of the game "2048" written in C++.
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.
g++
, clang++
, etc.)$ git clone https://github.com/plibither8/2048.cpp
$ cd 2048.cpp
build
folder (Optional):$ mkdir build
2048.cpp
file and create an output using the Makefile:$ make
$ ./build/2048.out
board[y][x]
'x' => x-axis OR the horizontal line OR columns
'y' => y-axis OR the vertical line OR rows
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.