[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: computer-go: Super-Ko



> About Super-Ko
> 
> How much speed will it take out of a program, 
> if for every move the total numbers of stones actual on the board is counted and stores in an array,
> and the Super-Ko is only checked with the prevous board position where the count of stones is equal to the present position ?

That's still neither as simple nor as fast as looking up the current boardhash
in a hashtable. E.g. in java you can just define a

  HashSet oldboards = new HashSet();

and a new move will violate superko if

  oldboards.add(board.zobristHash()) == false

(add() returns true if its argument is not already present)
this will take constant time.

regards,

%!PS                       %  -John Tromp (http://www.cwi.nl/~tromp/)
42 42 scale 7 9 translate .07 setlinewidth .5 setgray/c{arc clip fill
setgray}def 1 0 0 42 1 0 c 0 1 1{0 3 3 90 270 arc 0 0 6 0 -3 3 90 270
arcn 270 90 c -2 2 4{-6 moveto 0 12 rlineto}for -5 2 5{-3 exch moveto
9 0 rlineto}for stroke 0 0 3 1 1 0 c 180 rotate initclip}for showpage