Prompted by the use of New Zealand rules in the Computer Olympiad I
have at long last implemented superko detection and working suicide
options. See tickets #132 and #134 at http://trac.gnugo.org/gnugo for
more information and the patch.
After the patch there are four different ko rule options
--simple-ko, only forbid immediate recapture of a normal ko (default),
--no-ko, allow any kind of board repetition,
--positional-superko, forbid repetition of a previous position,
--situational-superko, forbid repetition of a previous position with
the same player to move,
and three different suicide options
--forbid-suicide, all suicide moves forbidden (default),
--allow-suicide, allow suicide but not of single stones,
--allow-all-suicide, allow all suicide moves.
GNU Go itself still won't generate suicide moves, neither will it
recapture a simple ko with --no-ko. It may play superko repetitions
when such rules are not used, however.
Summary of changes:
- new static functions really_do_trymove() and is_superko_violation()
in board.c
- store board hashes in the move history
- is_legal() does no longer depend on allow_suicide
- new function is_allowed_move() to determine legality with respect to
current suicide and ko rules
- new global variables suicide_rule and ko_rule
- replace illegal moves with passes near the end of do_genmove()
- reevaluate_ko_threats() revised
- look for ko threats also if best move is a superko violation,
assuming superko rules are used
- new suicide options --forbid-suicide (default) and
--allow-all-suicide, in addition to the earlier --allow-suicide
- new ko rule options --simple-ko (default), --no-ko,
positional-superko, and --situational-superko
- use is_allowed_move() instead of is_legal() in play_gtp.c,
play_ascii.c, and play_solo.c
/Gunnar
_______________________________________________
gnugo-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnugo-devel