Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Javran committed Mar 23, 2014
1 parent a7aa990 commit b05f8e9
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,24 @@ you can use the following command to build this project:

cabal build

The executable will be located at `dist/build/h2048-simple/h2048-simple`,
The executable will be located at `dist/build/h2048-simple/h2048-vty`,
to run the program:

./dist/build/h2048-simple/h2048-simple
./dist/build/h2048-simple/h2048-vty

Or alternatively:

cabal run h2048-vty

If you have trouble building the `vty` CLI version,
you can try to turn off feature `vty` it and use `h2028-simple`:

cabal configure --flag="-vty"
cabal build
# now the program should be ready
cabal run h2048-simple
# or alternatively:
./dist/build/h2048-simple/h2048-simple

### Without cabal

Expand All @@ -30,19 +40,29 @@ First make sure the following dependencies are installed:
* [mtl](http://hackage.haskell.org/package/mtl)
* [MonadRandom](http://hackage.haskell.org/package/MonadRandom)

You can use following commands to run this project without cabal:
In addition, if you want to play with vty CLI version, the following dependencies
are also required:

* [text](http://hackage.haskell.org/package/text)
* [vty](http://hackage.haskell.org/package/vty)
* [vty-ui](http://hackage.haskell.org/package/vty-ui)

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

Run command `runhaskell h2048.hs` from your terminal.

keys:

* `q`: quit
* `i`: up
* `k`: down
* `j`: left
* `l`: right

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

0 comments on commit b05f8e9

Please sign in to comment.