Michael,

Your code works just fine as far as it is concerned,
provided that the board already prevents simple-kos,
and detects 2 passes as end of game and that you
repeat the triple ko twice. This is your code:

       if(move[n-1] == move[n- 7] &&
          move[n-2] == move[n- 8] &&
          move[n-3] == move[n- 9] &&
          move[n-4] == move[n-10] &&
          move[n-5] == move[n-11] &&
          move[n-6] == move[n-12])
      { triple ko }

However if you play a triple ko once (6 moves), then
play away, then play the triple ko again, it will not
be detected.

The following code will detect triple ko the first
time. This requires that ko locations be kept along
with the move locations. If there is any form of undo,
then the ko info is already being kept.

      if(move[n  ] == ko[n-3] &&
         move[n-1] == ko[n-4] &&
         move[n-2] == ko[n-5] &&
         move[n-3] == ko[n-6])
      { triple ko }

Michael Wing


> Michael Williams:
>
> You might be speaking in general terms, I'm talking about a
> specific test for full-board repetition due to triple ko.
> In this case the sequences that you are comparing would be
> the same length.  So the test would look something like this
> (forgive me if I screw up the indexes):

> if (move[n-1]==move[n-7] && move[n-2]==move[n-8] &&
>     move[n-3]==move[n-9] && move[n-4]==move[n-10] &&
>     move[n-5]==move[n-11] && move[n-6]==move[n-12])
> {
>     // We have seen this board before
>     // Let's abort the playout and score it as-as.
> }

> Note that I'm only talking about this in the context of
> playouts, so it is ok if a position repeated and this test
> didn't catch it.  This is just a possible way to shorten the
> playouts.  I haven't tried this to see if it matters, I'm
> just thinking out loud here.

> The question is, does the test above ever cause a
> false-positive?  In other words, is the first comment line
> ever incorrect?



_______________________________________________
computer-go mailing list
[email protected]
http://www.computer-go.org/mailman/listinfo/computer-go/

Reply via email to