[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnugo-devel] readconnect patch
From: |
Gunnar Farnebäck |
Subject: |
[gnugo-devel] readconnect patch |
Date: |
Wed, 20 Oct 2004 05:49:25 +0200 |
User-agent: |
EMH/1.14.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.3 Emacs/21.3 (sparc-sun-solaris2.9) MULE/5.0 (SAKAKI) |
This patch makes a small change in the readconnect code. Regression
results:
nngs:1280 PASS D13 [D13]
gunnar:54 pass (fails in cvs)
2 PASS (1 PASS, 1 pass)
Total nodes: 1643843760 3037500 12966372 (-0.015% +0.0068% -0.2%)
Both passes are very good and solves mysterious-looking mistakes in
the breakin analysis.
- check_self_atari() in readconnect.c revised
/Gunnar
Index: engine/readconnect.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/readconnect.c,v
retrieving revision 1.83
diff -u -r1.83 readconnect.c
--- engine/readconnect.c 24 Aug 2004 14:39:53 -0000 1.83
+++ engine/readconnect.c 22 Sep 2004 15:39:55 -0000
@@ -4259,11 +4259,25 @@
* I leave the code in for a while. /gf
*
* Code reactivated, see nando:31. /nn
+ *
+ * Added requirement that no additional stones are sacrificed in the
+ * self atari. /gf
+ *
+ * FIXME: Add a function in board.c to check how big the string
+ * becomes when playing a move and use for the isolated stone
+ * test below.
*/
if (approxlib(pos, color_to_move, 1, &lib) >= 1
&& approxlib(lib, OTHER_COLOR(color_to_move), 3, NULL) <= 2
- && ladder_capturable(lib, OTHER_COLOR(color_to_move)))
- return 1;
+ && ladder_capturable(lib, OTHER_COLOR(color_to_move))) {
+ int k;
+ for (k = 0; k < 4; k++) {
+ if (board[pos + delta[k]] == color_to_move)
+ break;
+ }
+ if (k == 4)
+ return 1;
+ }
#endif
return 0;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnugo-devel] readconnect patch,
Gunnar Farnebäck <=