From 4ed03224f04d35b8a86858fbea10edd6b368889a Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Tue, 8 Dec 2009 10:57:45 +0100 Subject: [PATCH] Pattern FEAT_SELFATARI: Implement (smart version only) --- pattern.c | 5 +++++ pattern.h | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pattern.c b/pattern.c index 2937925..e9477bd 100644 --- a/pattern.c +++ b/pattern.c @@ -113,6 +113,11 @@ pattern_get(struct pattern *p, struct board *b, struct move *m) /* FEAT_AESCAPE */ /* FEAT_SELFATARI */ + if (is_bad_selfatari(b, m->color, m->coord)) { + f->id = FEAT_SELFATARI; + /* TODO: Dumb selfatari detection. */ + f->payload = 1 << PF_SELFATARI_SMART; + } /* FEAT_ATARI */ diff --git a/pattern.h b/pattern.h index 6291374..4c31100 100644 --- a/pattern.h +++ b/pattern.h @@ -39,6 +39,11 @@ enum feature_id { #define PF_CAPTURE_KO 3 FEAT_CAPTURE, + /* Self-atari move. */ + /* Payload: [bit0] Also using our complex definition? */ +#define PF_SELFATARI_SMART 0 /* TODO: Non-smart */ + FEAT_SELFATARI, + /* Unimplemented - TODO: */ @@ -54,11 +59,6 @@ enum feature_id { #define PF_AESCAPE_LADDER 0 FEAT_AESCAPE, - /* Self-atari move. */ - /* Payload: [bit0] Also using our complex definition? */ -#define PF_SELFATARI_SMART 0 - FEAT_SELFATARI, - /* Atari move. */ /* Payload: [bit0] The atari'd group gets laddered? */ #define PF_ATARI_LADDER 0 -- 2.11.4.GIT