From 9488434a0207a4a8639899af3c71397bd5500d27 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Sat, 11 Sep 2010 13:15:27 +0200 Subject: [PATCH] Moggy: Introduce capcheckall switch for global_atari_check() --- playout/moggy.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/playout/moggy.c b/playout/moggy.c index 38736ce..e5ca055 100644 --- a/playout/moggy.c +++ b/playout/moggy.c @@ -52,6 +52,9 @@ struct moggy_policy { /* Whether, when self-atari attempt is detected, to play the other * group's liberty if that is non-self-atari. */ bool selfatari_other; + /* Whether to always pick from moves capturing all groups in + * global_atari_check(). */ + bool capcheckall; struct joseki_dict *jdict; struct pattern3s patterns; @@ -497,6 +500,15 @@ global_atari_check(struct playout_policy *p, struct board *b, enum stone to_play if (b->clen == 0) return; + struct moggy_policy *pp = p->data; + if (pp->capcheckall) { + for (int g = 0; g < b->clen; g++) + group_atari_check(p, b, group_at(b, group_base(b->c[g])), to_play, q, NULL, s, MQ_GATARI); + if (PLDEBUGL(5)) + mq_print(q, b, "Global atari"); + return; + } + int g_base = fast_random(b->clen); for (int g = g_base; g < b->clen; g++) { group_atari_check(p, b, group_at(b, group_base(b->c[g])), to_play, q, NULL, s, MQ_GATARI); @@ -1198,6 +1210,8 @@ playout_moggy_init(char *arg, struct board *b, struct joseki_dict *jdict) pp->pattern2 = optval && *optval == '0' ? false : true; } else if (!strcasecmp(optname, "selfatari_other")) { pp->selfatari_other = optval && *optval == '0' ? false : true; + } else if (!strcasecmp(optname, "capcheckall")) { + pp->capcheckall = optval && *optval == '0' ? false : true; } else if (!strcasecmp(optname, "fullchoose")) { p->choose = optval && *optval == '0' ? playout_moggy_partchoose : playout_moggy_fullchoose; } else if (!strcasecmp(optname, "mqprob") && optval) { -- 2.11.4.GIT