hstzaar: A two player abstract strategy game.

[ bsd3, game, program ] [ Propose Tags ]

HsTZAAR is an implementation of TZAAR ((c) 2007 Kris Brum), a two player abstract strategy game played on a hexagonal board. TZAAR is the the last game in the GIPF game series. This program is based on the (retired) htzaar implementation by Tom Hawkins tomahawkins@gmail.com.

[Skip to Readme]
Versions [faq] 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.8.1, 0.8.2, 0.9, 0.9.1, 0.9.2, 0.9.3, 0.9.4
Dependencies base (==4.*), cairo (>=0.11), containers, glade (>=0.11), gtk (>=0.11), haskell98, QuickCheck (>=2.1), random (>=1.0.0 && <1.1) [details]
License BSD-3-Clause
Author Pedro Vasconcelos <pbv@ncc.up.pt>
Maintainer Pedro Vasconcelos <pbv@ncc.up.pt>
Category Game
Home page http://www.ncc.up.pt/~pbv/stuff/hstzaar
Uploaded by PedroVasconcelos at Wed Sep 22 10:41:34 UTC 2010
Distributions NixOS:0.9.4
Executables hstzaar
Downloads 6075 total (141 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs not available [build log]
All reported builds failed as of 2016-12-28 [all 8 reports]


Maintainer's Corner

For package maintainers and hackage trustees

Readme for hstzaar-0.4

[back to package description]

HsTZAAR is a computer program to play TZAAR, a 2-player abstract strategy
game designed by Kris Burm and the last game in the GIPF project.
HsTZAAR is written in Haskell and allows for local play against a computer AI;
it also provides a good interface for programmers to implement diferent 
AI strategies.

This program was based on the htzaar implementation by Tom Hawkins.
In 2010, I started experimenting with classical AI techniques for TZAAR
and implemented them on-top of htzaar; since the later package is longer
updated, I decided to start HsTZAAR.

The main improvements so far are:

    * a better GUI using gtk2hs for widgets and cairo for high-quality 
      2D board rendering.
    * a better AI using minimax and alpha-beta prunning; it now plays at
      a challenging level (at least for a beginner like myself). 


HsTZAAR requires a resonably recent GHC compiler (version 6.10.x or newer) 
plus the gtk2hs, cairo and glade libraries. It is developed in Ubuntu 
GNU/Linux system, and should compile and run fine on other Linuxes. 
I also verified that it compiles under Mac OS X (snow leopard) and should
probabily do under Windows as well (but this was not tested).


Using the Haskell Cabal tool (fetches the package and any dependencies, 
builds and installs):

      $ cabal install hstzaar

Alternatively, you can do the build manually from the source tarball:

$ tar xvzf hstzaar-x.y.tar.gz
$ cd hstzaar-x.y
$ runhaskell Setup.hs configure
$ runhaskell Setup.hs build
$ runhaskell Setup.hs install

AI strategies

HsTZAAR implements a few AI strategies.
  lame:    selects a random valid move
  greedy:  selects the local best move by the static evaluation function
  plyN:    simple minimaxing to N-ply
  dynN:    greedy strategy for early game, then minimaxing N-ply for later game
All of the above will select a winning move or a move to prevent the 
adversary from winning (if such moves are avaliable).

Note that higher ply values can increase memory consumption dramatically 
and do *not* necessarily play better! The default greedy strategy plays
well enough to challenge a beginner such as myself and run under 150Mb
resident space.


Executing the binary starts the GUI interface for playing against an AI;
some extra options are controlled by command line arguments:

hstzaar [OPTION..] [AI AI] where OPTIONS are
  -s SEED  --seed=SEED  random number seed
  -n N     --matches=N  number of matches (for AI tournaments)
  -T       --tests      run QuickCheck tests


1) Run a tournament between the greedy and ply2 strategies: 
   10 matches (5 random boards, each strategy plays first white
   then black, fixing the random seed for repeatebility):

   $ hstzaar -s0 -n10 greedy ply2

2) Run QuickCheck correctness tests (see source code for details on these):

   $ hstzaar --tests

Pedro Vasconcelos, 2010