GithubHelp home page GithubHelp logo

linecode / 2048.cpp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from plibither8/2048.cpp

0.0 2.0 0.0 584 KB

๐ŸŽฎ Terminal version of the game "2048" written in C++ 11

License: MIT License

C++ 97.42% CMake 0.61% Makefile 1.97%

2048.cpp's Introduction

2048.cpp

Build Status Build status Made with Love in India

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

๐ŸŽ‰ Featured on GitHub's Twitter and Facebook pages! ๐ŸŽ‰

Demo of usage

To-Do

  • 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)

Setup

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.

Requirements

  • C++ compiler (e.g. g++, clang++, etc.)
  • Linux, MacOS OR Windows with a working terminal (Cygwin, Windows Subsystem for Linux or Git bash is recommended for Windows)

Instructions

  1. Open your terminal in your preferred directory and clone this project:
$ git clone https://github.com/plibither8/2048.cpp
  1. Enter the project directory:
$ cd 2048.cpp
  1. Create a build folder (Optional):
$ mkdir build
  1. Compile the 2048.cpp file and create an output using the Makefile:
$ make
  1. Run the program and play the game!
$ ./build/2048.out

Notes

  • Game board array is defined as board[y][x]
  • 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[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:

+------+------+------+------+
|      |      |      |      |
+------+------+------+------+
|      |      |      |      |
+------+------+------+------+
|   @  |      |      |      |
+------+------+------+------+
|      |      |      |      |
+------+------+------+------+

License

Copyright (c) Mihir Chaturvedi. All rights reserved.

Licensed under the MIT License.

2048.cpp's People

Contributors

jcelerier avatar patrikhuber avatar plibither8 avatar pokgak avatar scivision avatar zestze avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.