ANNOUNCE: htzaar-0.0.1

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

ANNOUNCE: htzaar-0.0.1

Tom Hawkins-2
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.
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: ANNOUNCE: htzaar-0.0.1

Roel van Dijk-3
On Thu, Oct 8, 2009 at 12:56 AM, Tom Hawkins <[hidden email]> wrote:
> Known bugs: Occasionally HTZAAR throws a Prelude.head: empty list.
> I'm still trying to track this down.

I used the following function to track down a similar problem:

myhead :: String -> [a] -> a
myhead msg [] = error msg
myhead _ (x:_) = x

Then you can replace your calls to head with myhead "bla". This way it
is faster to pin-point which head is applied to an empty list.
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: ANNOUNCE: htzaar-0.0.1

Jose A. Ortega Ruiz-2
In reply to this post by Tom Hawkins-2

Hi,

When i try to cabal install htzaar i get the following error:

src/Main.hs:11:7:
    Could not find module `Play':
      Use -v to see a list of the files searched for.
cabal: Error: some packages failed to install:
htzaar-0.0.1 failed during the building phase. The exception was:
exit: ExitFailure 1

Any idea about what's going on?

Thanks!
jao
--
Editing is a rewording activity.
  - Alan Perlis, Epigrams in Programing

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Re: ANNOUNCE: htzaar-0.0.1

Alexey Khudyakov
В сообщении от 09 октября 2009 16:24:49 Jose A. Ortega Ruiz написал:

> Hi,
>
> When i try to cabal install htzaar i get the following error:
>
> src/Main.hs:11:7:
>     Could not find module `Play':
>       Use -v to see a list of the files searched for.
> cabal: Error: some packages failed to install:
> htzaar-0.0.1 failed during the building phase. The exception was:
> exit: ExitFailure 1
>
> Any idea about what's going on?
>
Modules AI, Play and Board are missing I believe
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Re: ANNOUNCE: htzaar-0.0.1

Tom Hawkins-2
In reply to this post by Jose A. Ortega Ruiz-2
On Fri, Oct 9, 2009 at 2:24 PM, Jose A. Ortega Ruiz <[hidden email]> wrote:

>
> Hi,
>
> When i try to cabal install htzaar i get the following error:
>
> src/Main.hs:11:7:
>    Could not find module `Play':
>      Use -v to see a list of the files searched for.
> cabal: Error: some packages failed to install:
> htzaar-0.0.1 failed during the building phase. The exception was:
> exit: ExitFailure 1
>
> Any idea about what's going on?


Sorry, I forgot to add the other modules to the cabal file.  Try htzaar-0.0.2.
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: ANNOUNCE: htzaar-0.0.1

Jose A. Ortega Ruiz-2
Tom Hawkins <[hidden email]> writes:

> Sorry, I forgot to add the other modules to the cabal file.  Try
> htzaar-0.0.2.

Thank you, it's working now.

jao
--
The reasonable man adapts himself to the world; the unreasonable
one persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man. - George Bernard Shaw

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe