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 tomahawkins@gmail.com.


[Skip to ReadMe]

Properties

Versions0.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
Change logNone available
Dependenciesbase (==4.*), cairo (>=0.11), containers, glade (>=0.11), gtk (>=0.11), haskell98, QuickCheck (>=2.1), random (>=1.0.0 && <1.1) [details]
LicenseBSD3
AuthorPedro Vasconcelos <pbv@ncc.up.pt>
MaintainerPedro Vasconcelos <pbv@ncc.up.pt>
CategoryGame
Home pagehttp://www.ncc.up.pt/~pbv/stuff/hstzaar
Executableshstzaar
UploadedTue Mar 29 14:03:21 UTC 2011 by PedroVasconcelos
Downloads2042 total (107 in last 30 days)
Votes
0 []
StatusDocs not available [build log]
All reported builds failed as of 2015-06-01 [all 3 reports]

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for hstzaar-0.5

HsTZAAR 
-------

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). 

Requirements
------------

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).

Compilation
-----------

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.

Usage
-----

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

Examples:

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
pbv@dcc.fc.up.pt