The hstzaar package

[Tags:bsd3, program]

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

[Skip to Readme]


Versions 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 BSD3
Author Pedro Vasconcelos <>
Maintainer Pedro Vasconcelos <>
Category Game
Home page
Uploaded Wed Sep 22 10:41:34 UTC 2010 by PedroVasconcelos
Distributions NixOS:0.9.4
Downloads 2928 total (15 in the last 30 days)
0 []
Status 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

Readme for hstzaar-0.4


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