Giter Club home page Giter Club logo

2048haskell's Introduction

2048Haskell

┏━━Score━━┓    ┏━━━━━━━━━━━━━━━━2048━━━━━━━━━━━━━━━━┓    ┏━━━━━Commands━━━━━┓
             ┃┏━━━━━━━┓┏━━━━━━━┓┏━━━━━━━┓┏━━━━━━━┓┃     Left            
   256       ┃┃       ┃┃       ┃┃       ┃┃       ┃┃     Right           
             ┃┃  256  ┃┃   8   ┃┃   4   ┃┃  16   ┃┃     Down            
┗━━━━━━━━━┛    ┃┃       ┃┃       ┃┃       ┃┃       ┃┃     Restart        r 
               ┃┗━━━━━━━┛┗━━━━━━━┛┗━━━━━━━┛┗━━━━━━━┛┃     Quit    q or esc 
               ┃┏━━━━━━━┓┏━━━━━━━┓┏━━━━━━━┓┏━━━━━━━┓┃    ┗━━━━━━━━━━━━━━━━━━┛
 GAME OVER     ┃┃       ┃┃       ┃┃       ┃┃       ┃┃
               ┃┃   4   ┃┃  64   ┃┃  16   ┃┃   8   ┃┃
               ┃┃       ┃┃       ┃┃       ┃┃       ┃┃
               ┃┗━━━━━━━┛┗━━━━━━━┛┗━━━━━━━┛┗━━━━━━━┛┃
               ┃┏━━━━━━━┓┏━━━━━━━┓┏━━━━━━━┓┏━━━━━━━┓┃
               ┃┃       ┃┃       ┃┃       ┃┃       ┃┃
               ┃┃   2   ┃┃  16   ┃┃   8   ┃┃   4   ┃┃
               ┃┃       ┃┃       ┃┃       ┃┃       ┃┃
               ┃┗━━━━━━━┛┗━━━━━━━┛┗━━━━━━━┛┗━━━━━━━┛┃
               ┃┏━━━━━━━┓┏━━━━━━━┓┏━━━━━━━┓┏━━━━━━━┓┃
               ┃┃       ┃┃       ┃┃       ┃┃       ┃┃
               ┃┃  16   ┃┃   8   ┃┃   4   ┃┃   2   ┃┃
               ┃┃       ┃┃       ┃┃       ┃┃       ┃┃
               ┃┗━━━━━━━┛┗━━━━━━━┛┗━━━━━━━┛┗━━━━━━━┛┃
               ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

Run:

cabal run 2048Haskell

You will then be greeted by a screen on which you can select the game mode:

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━Select mode (type key)━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ h                                                        Human Player (YOU!) ┃
┃ m                                                            Monte Carlo Bot ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

Rules:

Board is a 4x4 grid with 16 square tiles. Possible moves: Left , Right , Up , Down

  1. +2/+4: At each step a new tile that is a random multiple of 2 will be placed in the board.
  2. move: When you select one of the moves, all tiles will move as far as possible in that direction in the grid.
  3. x+x=2x: If a tile is moved to a tile of the same value, then they will combine into 1 tile with the value of their sum.
  4. 2048: The objective is to get a highest tile value. You win by reaching the tile 2048.

2048haskell's People

Contributors

8gitbrix avatar seoular 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.