[Haskell-cafe] ANNOUNCE: htzaar-0.0.1

Tom Hawkins tomahawkins at gmail.com
Wed Oct 7 18:56:06 EDT 2009


HTZAAR is a Haskell implementation of TZAAR, a great little two-player
abstract strategy game designed by Kris Burm.  TZAAR won Games
Magazine's Game-of-the-Year in 2008.

TZAAR has some interesting game dynamics.  At each turn a player must
decide whether to attack or strengthen his own pieces.  The unbalanced
number of tzaars, tzarras, and totts pieces leads to several phase
transitions in the game.  At first tzaars are targeted, but once
they're fortified, tzarras become the targets, then totts.  It also
has a rather distinct transition from mid to end game.  Midway
through, most effort is on positioning power pieces for attack.  But
as more pieces come off the board, movement is restricted to the point
where groups become isolated from others, which can work for or
against you.

Anyway, I thought the game would be a fun AI problem.  HTZAAR comes
with a very simple AI opponent (lame), but I did my best to structure
the interface to make it easy to create new AI strategies.  I hope a
few people try to build and contribute AI strategies to HTZAAR.  And
if there's anyway I can improve the AI interface, let me know.

HTZAAR can also pit AI against AI.  The following is a game between
two instances of the "lame" AI.  For an idea of the complexity of
TZAAR, the number in parentheses indicates the number of possible
moves at each turn.  TZAAR has a large number of choices at each turn
because each turn consists of two different moves (n^2).  Typical
games are between 15 to 25 turns.

$ htzaar -s 22 lame lame
 1. white (lame) : D7 -> E7                    (42)
 2. black (lame) : F6 -> F5    G1 -> F2        (6355)
 3. white (lame) : D6 -> E6    A5 -> A4        (5867)
 4. black (lame) : F3 -> E4    H2 -> G2        (5227)
 5. white (lame) : I2 -> I1    C5 -> C6        (4992)
 6. black (lame) : F5 -> G4    H1 -> H3        (4345)
 7. white (lame) : H5 -> G6    C6 -> C7        (4176)
 8. black (lame) : F7 -> E7    D4 -> C3        (4265)
 9. white (lame) : G6 -> E5    H4 -> G5        (3464)
10. black (lame) : H6 -> I5    F2 -> E2        (2870)
11. white (lame) : E5 -> G4    D2 -> D1        (2303)
12. black (lame) : B2 -> C2    G7 -> I5        (2742)
13. white (lame) : G5 -> I5    E6 -> I3        (1965)
14. black (lame) : E7 -> B5    G3 -> E3        (2055)
15. white (lame) : E1 -> F1    I4 -> I3        (1303)
16. black (lame) : E2 -> D1    C4 -> D5        (1656)
17. white (lame) : I5 -> F8    C7 -> I3        (913)
18. black (lame) : B5 -> A4    E4 -> B4        (1480)
19. white (lame) : D3 -> C2    B1 -> C2        (608)
20. black (lame) : B4 -> B6    C3 -> C2        (526)
21. white (lame) : D8 -> E8    F1 -> F4        (185)
22. black (lame) : H3 -> G4    B3 -> B6        (314)
23. white (lame) : C1 -> A1    F4 -> G4        (47)
24. black (lame) : B6 -> E8    E8 -> F8        (125)
black (lame) Wins!

Screenshots and links: http://tomahawkins.org

Known bugs: Occasionally HTZAAR throws a Prelude.head: empty list.
I'm still trying to track this down.


More information about the Haskell-Cafe mailing list