[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [gnugo-devel] nando_3_9.4
From: |
Arend Bayer |
Subject: |
RE: [gnugo-devel] nando_3_9.4 |
Date: |
Wed, 18 Sep 2002 15:33:48 +0200 (CEST) |
There are certainly lots of places where the patch could get extended,
but I guess it would be best think it would be best if we could merge
s.th. into CVS before we start doing that.
That's why I'd suggest a minimal fix for the problem I'd described
(about setting the whole dragon critical). Instead of touching
influence.c we could do a workaround as below (untested and not yet
working, as owl_reasons() ignores all non-critical dragons). I think
this should give about reasonable valuations for all cases.
Would that make sense?
Arend
--- engine/dragon.c.orig Wed Sep 18 14:32:43 2002
+++ engine/dragon.c Wed Sep 18 14:33:56 2002
@@ -401,7 +401,10 @@
&dragon[str].owl_defense_certain, &kworm);
if (dcode != 0) {
if (defense_point != NO_MOVE) {
- dragon[str].owl_status = CRITICAL;
+ if (acode == GAIN)
+ dragon[str].owl_status = ALIVE;
+ else
+ dragon[str].owl_status = CRITICAL;
dragon[str].owl_defense_point = defense_point;
dragon[str].owl_defense_code = dcode;
dragon[str].owl_defense_kworm = kworm;
--- engine/value_moves.c.orig Wed Sep 18 14:32:49 2002
+++ engine/value_moves.c Wed Sep 18 14:46:45 2002
@@ -1587,6 +1587,19 @@
case OWL_DEFEND_MOVE_LOSS:
aa = dragons[move_reasons[r].what];
+ /* FIXME: This is to handle a defense of a dragon where only a
+ * tail can be captured by the opponent (i.e. attack code GAIN).
+ * Should be included with the territorial evaluation in influence.c
+ * instead.
+ */
+ if (move_reasons[r].type == OWL_DEFEND_MOVE
+ && dragon[aa].status == ALIVE
+ && dragon[aa].owl_attack_code == GAIN) {
+ ASSERT_ON_BOARD1(dragon[aa].owl_attack_kworm);
+ tot_value += worm[dragon[aa].owl_attack_kworm].effective_size;
+ break;
+ }
+
/* If the dragon is a single ko stone, the owl code currently
* won't detect that the owl attack is conditional. As a
* workaround we deduct 0.5 points for the move here, but only