h2048: a haskell implementation of Game 2048

[ game, library, mit, program ] [ Propose Tags ]

A haskell implementation of Game 2048, based on https://github.com/gabrielecirulli/2048.


[Skip to Readme]

Flags

Automatic Flags
NameDescriptionDefault
exe

build executables

Enabled
vty

build UI written in vty-ui

Enabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.1, 0.1.0.2, 0.2.0.0, 0.2.0.1, 0.3.0.0, 0.4.0.0
Change log CHANGELOG.md
Dependencies base (>=4 && <5), MonadRandom (<1), mtl (>=2 && <3), text (>=1 && <2), transformers (<1), vty (>=4 && <6), vty-ui (>=1 && <2) [details]
License MIT
Copyright Copyright (c) 2014 Javran Cheng
Author Javran Cheng
Maintainer Javran.C@gmail.com
Category Game
Home page https://github.com/Javran/h2048
Uploaded by javran at 2014-10-15T03:28:09Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Executables h2048-vty, h2048-simple
Downloads 4228 total (14 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for h2048-0.2.0.0

[back to package description]

h2048

Build Status

A haskell implementation of Game 2048. Including:

  • a library for experimenting game strategies for Game 2048
  • a simple CLI that merely pretty-prints the game board
  • a better CLI implemented using vty-ui

Based on 2048

Screenshots

Simple CLI version

vty CLI version

Build and run

With cabal

h2048 is now available on hackage.

If you have Cabal installed, you can use the following command to install this project:

cabal update
cabal install h2048

The binaries are h2048-simple for simple CLI version, h2048-vty for CLI version implemented using vty-ui.

Flags

If you just want the functionality of this library, you can turn off flag exe. If you have trouble building the vty CLI version, you can try to turn off flag vty.

An example for turning off flag vty:

# if you are installing package from hackage:
cabal install --flag="-vty"

# or if you are building from the github repo
cabal configure --flag="-vty"
cabal build

Without cabal

First make sure the following dependencies are installed:

In addition, if you want to play with vty CLI version, the following dependencies are also required:

You can use following commands to run the program without cabal:

cd src # assume your working directory is the project home.
# to play the simple CLI version
runhaskell MainSimple.hs
# to play the vty CLI version
runhaskell MainVty.hs

How to play

keys:

  • q: quit
  • i: up
  • k: down
  • j: left
  • l: right

If you are using h2048-vty, you can also use arrow keys.