gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnugo-devel] trevor_1_14.6


From: Daniel Bump
Subject: Re: [gnugo-devel] trevor_1_14.6
Date: Fri, 16 Nov 2001 16:08:18 -0800

> Trevor wrote:
> > http://www.public32.com/games/go/trevor_1_14.6
> >  - Adds sgf file optional parameter to owl_attack
> >
> > Assuming this is OK w/ all, I'll add same to owl_defend shortly.
> 
> I'd prefer to fix so that gtp_start_sgftrace and gtp_finish_sgftrace
> gives a meaningful result with owl_attack and owl_defend. This
> probably requires turning off sgf traces during the examine_position()
> call.

Trevor, does the following suit your needs?

This patch makes it possible to create sgf files during the owl_attack
and owl_defend from the gtp. Sample session:

loadsgf incident66.sgf 52
= black

start_sgftrace vars.sgf
= 

owl_attack D8
= 1 F8

finish_sgftrace vars.sgf
= 

The variations will be in the file vars.sgf.


- gtp_owl_attack and gtp_owl_defend cache sgftree during examine_position



===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/board.c,v
retrieving revision 1.19
diff -u -r1.19 board.c
--- engine/board.c      2001/11/10 14:07:10     1.19
+++ engine/board.c      2001/11/17 00:03:56
@@ -391,7 +391,8 @@
     }
     else {
       if (komaster != EMPTY)
-       gg_snprintf(buf, 100, "%s at %s (variation %d, hash %lx, komaster 
%s:%s)", 
+       gg_snprintf(buf, 100, 
+                   "%s at %s (variation %d, hash %lx, komaster %s:%s)", 
                    message, location_to_string(str), count_variations,
                    hashdata.hashval, color_to_string(komaster),
                    location_to_string(kom_pos));
Index: interface/play_gtp.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/interface/play_gtp.c,v
retrieving revision 1.45
diff -u -r1.45 play_gtp.c
--- interface/play_gtp.c        2001/11/15 21:47:55     1.45
+++ interface/play_gtp.c        2001/11/17 00:03:56
@@ -855,6 +855,7 @@
   int attack_code;
   int save_verbose = verbose;
   int result_certain;
+  SGFTree *save_sgf_dumptree = sgf_dumptree;
 
   if (!gtp_decode_coord(s, &i, &j))
     return gtp_failure(id, "invalid coordinate");
@@ -863,8 +864,10 @@
     return gtp_failure(id, "vertex must not be empty");
 
   verbose = 0;
+  sgf_dumptree = NULL;
   examine_position(BOARD(i, j), EXAMINE_DRAGONS_WITHOUT_OWL);
   verbose = save_verbose;
+  sgf_dumptree = save_sgf_dumptree;
   
   attack_code = owl_attack(POS(i, j), &attack_point, &result_certain);
   gtp_printid(id, GTP_SUCCESS);
@@ -892,6 +895,7 @@
   int defend_code;
   int save_verbose = verbose;
   int result_certain;
+  SGFTree *save_sgf_dumptree = sgf_dumptree;
   
   if (!gtp_decode_coord(s, &i, &j))
     return gtp_failure(id, "invalid coordinate");
@@ -900,8 +904,10 @@
     return gtp_failure(id, "vertex must not be empty");
 
   verbose = 0;
+  sgf_dumptree = NULL;
   examine_position(BOARD(i, j), EXAMINE_DRAGONS_WITHOUT_OWL);
   verbose = save_verbose;
+  sgf_dumptree = save_sgf_dumptree;
 
   defend_code = owl_defend(POS(i, j), &defense_point, &result_certain);
   gtp_printid(id, GTP_SUCCESS);







reply via email to

[Prev in Thread] Current Thread [Next in Thread]