@@ -13,14 +13,24 @@ you can use the following command to build this project:
1313
1414 cabal build
1515
16- The executable will be located at ` dist/build/h2048-simple/h2048-simple ` ,
16+ The executable will be located at ` dist/build/h2048-simple/h2048-vty ` ,
1717to run the program:
1818
19- ./dist/build/h2048-simple/h2048-simple
19+ ./dist/build/h2048-simple/h2048-vty
2020
2121Or alternatively:
2222
23+ cabal run h2048-vty
24+
25+ If you have trouble building the ` vty ` CLI version,
26+ you can try to turn off feature ` vty ` it and use ` h2028-simple ` :
27+
28+ cabal configure --flag="-vty"
29+ cabal build
30+ # now the program should be ready
2331 cabal run h2048-simple
32+ # or alternatively:
33+ ./dist/build/h2048-simple/h2048-simple
2434
2535### Without cabal
2636
@@ -30,19 +40,29 @@ First make sure the following dependencies are installed:
3040* [ mtl] ( http://hackage.haskell.org/package/mtl )
3141* [ MonadRandom] ( http://hackage.haskell.org/package/MonadRandom )
3242
33- You can use following commands to run this project without cabal:
43+ In addition, if you want to play with vty CLI version, the following dependencies
44+ are also required:
45+
46+ * [ text] ( http://hackage.haskell.org/package/text )
47+ * [ vty] ( http://hackage.haskell.org/package/vty )
48+ * [ vty-ui] ( http://hackage.haskell.org/package/vty-ui )
49+
50+ You can use following commands to run the program without cabal:
3451
3552 cd src # assume your working directory is the project home.
53+ # to play the simple CLI version
3654 runhaskell MainSimple.hs
55+ # to play the vty CLI version
56+ runhaskell MainVty.hs
3757
3858## How to play
3959
40- Run command ` runhaskell h2048.hs ` from your terminal.
41-
4260keys:
4361
4462* ` q ` : quit
4563* ` i ` : up
4664* ` k ` : down
4765* ` j ` : left
4866* ` l ` : right
67+
68+ If you are using ` h2048-vty ` , you can also use arrow keys.
0 commit comments