[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [computer-go] Chains and liberties
I'm a little late into this discussion, but I'd like to point out
a few uses of board code that frequently occur in GNU Go.
We have approxlib() and accuratelib() functions that predict the
number of liberties a player gains after a given move. The
difference between them is that approxlib() ignores captures
(hence it is "approximate".) In principle, accuratelib() is
identical to (in pseudocode)
play_move (pos, color);
result = count_liberties (pos);
undo_move ();
return result;
(Actually this is how it was implemented earlier.) However, in
GNU Go these functions don't alter the board (i.e. they don't play
the move.) This is a speed optimization that makes the functions
several times faster (at the cost of code complication of course.)
We also find that "approximate" result of approxlib() is very often
good enough, so the faster approxlib() is used more often than
accuratelib().
We also have a family of chainlinks*() functions that find opponent's
string adjacent to given string, possibly with restriction on the
number of liberties. This is what we track neighbours while playing
moves for. chainlinks*() are very useful in tactical reading.
Paul
_______________________________________________
computer-go mailing list
computer-go@xxxxxxxxxxxxxxxxx
http://www.computer-go.org/mailman/listinfo/computer-go/