Newsgroups: comp.ai.games
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!newsstand.cit.cornell.edu!portc01.blue.aol.com!portc02.blue.aol.com!howland.erols.net!news.mathworks.com!uunet!in1.uu.net!208.192.224.3!news.interactive.net!mmn
From: mmn@interactive.net (Michael Naunton)
Subject: Re: Looking for a good Tic-Tac-Toe algorithm.
X-Newsreader: slrn (0.9.2.1 BETA UNIX)
X-Nntp-Posting-User: mmn
Organization: IBS Interactive
Message-ID: <slrn5e5ntd.jb4.mmn@onyx.interactive.net>
References: <5bh4vl$moc@pulp.ucs.ualberta.ca> <32DE816E.167EB0E7@delicias.dia.fi.upm.es>
X-Trace: 853729197/23299
X-Nntp-Posting-Host: onyx.interactive.net
Date: Mon, 20 Jan 1997 02:59:58 GMT
Lines: 39

lost the original article, so I'm hacking up a followup :)

>Jon Martin wrote:
>> 2: slow, dreadfully slow
>>      #2 is the prime concern, because I want this game to be playable (max 1
>> minute for a computer move) at 4*4, 5*5, and perhaps beyond.  Can anyone point
>> me to a very aggressive and fast min-max, or should I be looking for something
>> more exotic?

Min-Max is probably overkill in this situation.
Back in 1978, I wrote a 4*4*4*4 tic-tac-toe.  It ran on an 8k machine :)
The play was not perfect, but was pretty good and very fast.  The
algorithm was as follows:

Compute the value of each row on the board (520 I think for 4^4) according
to a simple lookup table:
??XO = 0
.... = 1
...X = 2
...O = 3
..XX = 10
..OO = 16
.XXX = 100
.YYY = 1000

I forget the exact values, but you get the idea.

Score each of the (max 256) unplayed locations by summing the values of 
the rows that intersect them.

Play in the location with the highest score.  Pick randomly to break ties.

----

Regards,
Michael Naunton



