This patch adds a cutstone.tst testsuite. A 9x9 game record that shows some flaws in the cutstone algorithm (at least in my opinion) is added to the test suite. - new gtp command worm_cutstone - new testsuite cutstone.tst - new game record wormflaw.sgf Teun --------------59850728D1EC92E2D9B6F40B Content-Type: text/plain; charset=us-ascii; name="p27235-02.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="p27235-02.txt" diff -ruN gnugo-2.7.235/interface/play_gtp.c gx235x/interface/play_gtp.c --- gnugo-2.7.235/interface/play_gtp.c Fri May 4 04:29:52 2001 +++ gx235x/interface/play_gtp.c Wed May 16 21:24:48 2001 @@ -87,6 +87,7 @@ DECLARE(gtp_influence); DECLARE(gtp_move_influence); DECLARE(gtp_worm_data); +DECLARE(gtp_worm_cutstone); DECLARE(gtp_dragon_data); DECLARE(gtp_genmove); DECLARE(gtp_tune_move_ordering); @@ -137,6 +138,7 @@ {"debug_move_influence", gtp_debug_move_influence}, {"influence", gtp_influence}, {"move_influence", gtp_move_influence}, + {"worm_cutstone", gtp_worm_cutstone}, {"worm_data", gtp_worm_data}, {"dragon_data", gtp_dragon_data}, {"tune_move_ordering", gtp_tune_move_ordering}, @@ -1403,6 +1405,31 @@ return GTP_OK; } +/* Function: Return the cutstone field in the worm data structure. + * Arguments: non-empty vertex + * Fails: never + * Returns: cutstone + */ +static int +gtp_worm_cutstone(char *s, int id) +{ + + int i, j; + if (!gtp_decode_coord(s, &i, &j)) + return gtp_failure(id, "invalid coordinate"); + + if (p[i][j] == EMPTY) + return gtp_failure(id, "vertex must not be empty"); + + examine_position(EMPTY, EXAMINE_WORMS); + + gtp_printid(id, GTP_SUCCESS); + + gtp_printf(" %d\n", worm[i][j].cutstone); + + return GTP_OK; +} + /* Function: Return the information in the dragon data structure. * Arguments: optional intersection * Fails: never diff -ruN gnugo-2.7.235/regression/cutstone.tst gx235x/regression/cutstone.tst --- gnugo-2.7.235/regression/cutstone.tst Thu Jan 1 01:00:00 1970 +++ gx235x/regression/cutstone.tst Wed May 16 21:33:12 2001 @@ -0,0 +1,35 @@ +loadsgf games/wormflaw.sgf +1 worm_cutstone B9 +#? [2] + +loadsgf games/wormflaw.sgf +2 worm_cutstone C9 +#? [2] + +loadsgf games/wormflaw.sgf +3 worm_cutstone B8 +#? [2] + +loadsgf games/wormflaw.sgf +4 worm_cutstone C8 +#? [2] + +loadsgf games/wormflaw.sgf +5 worm_cutstone G9 +#? [0] + +loadsgf games/wormflaw.sgf +6 worm_cutstone G8 +#? [0]* + +loadsgf games/wormflaw.sgf +7 worm_cutstone F6 +#? [1] + +loadsgf games/wormflaw.sgf +8 worm_cutstone C3 +#? [0]* + +loadsgf games/wormflaw.sgf +9 worm_cutstone H1 +#? [0]* diff -ruN gnugo-2.7.235/regression/games/wormflaw.sgf gx235x/regression/games/wormflaw.sgf --- gnugo-2.7.235/regression/games/wormflaw.sgf Thu Jan 1 01:00:00 1970 +++ gx235x/regression/games/wormflaw.sgf Wed May 16 19:17:56 2001 @@ -0,0 +1,3 @@ +(;GM[1]FF[4]CA[UTF-8]AP[CGoban:2] +SZ[9]RU[Japanese]KM[0.00]TM[] +AW[ba][ga][ia][cb][fd][bf][if][di][ii]AB[ca][bb][gb][hb][ib][ed][fe][he][ie][cf][hf][cg][hg][ch][hh][ci][hi]) diff -ruN gnugo-2.7.235/regression/Makefile.am gx235x/regression/Makefile.am --- gnugo-2.7.235/regression/Makefile.am Sun Apr 29 18:18:10 2001 +++ gx235x/regression/Makefile.am Wed May 16 21:34:38 2001 @@ -4,7 +4,8 @@ owl_rot.tst heikki.tst golife.tst dniwog.tst \ nicklas1.tst nicklas2.tst nicklas3.tst nicklas4.tst nicklas5.tst \ filllib.tst arion.tst endgame.tst viking.tst ego.tst atari_atari.tst \ - score.tst ld_owl_rot.tst reading_rot.tst endgame_rot.tst manyfaces.tst + score.tst ld_owl_rot.tst reading_rot.tst endgame_rot.tst manyfaces.tst \ + cutstone.tst noinst_SCRIPTS = eval.sh regress.sh test.sh @@ -50,6 +51,9 @@ strategy3: strategy3.tst $(srcdir)/eval.sh strategy3.tst +cutstone: cutstone.tst + $(srcdir)/eval.sh cutstone.tst + ld_owl: ld_owl.tst $(srcdir)/eval.sh ld_owl.tst