gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] gprintf("%r"...) (was: large_scale_5_1.1b)


From: Arend Bayer
Subject: [gnugo-devel] gprintf("%r"...) (was: large_scale_5_1.1b)
Date: Wed, 2 Jun 2004 00:02:37 +0200 (CEST)


> The patch made use of a gprintf format character %r which
> would print a read result. This puzzles me since this
> feature does not seem to have been implemented. It is 
> obviously a useful feature, so I added it in vgprintf().

However, it has the drawback of reintroducing '#include "gnugo.h"' into
printutils.c, and thus breaking the nice independance of the board
library of the rest of the engine.

I think it would be useful to keep the board library separate. E.g. that way,
it can be used by other projects. So I would like to propose to revert
this as below.

Arend


Index: engine/printutils.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/printutils.c,v
retrieving revision 1.45
diff -u -p -r1.45 printutils.c
--- engine/printutils.c 23 Apr 2004 03:06:36 -0000      1.45
+++ engine/printutils.c 2 Jun 2004 02:57:48 -0000
@@ -21,7 +21,6 @@
 \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 #include "board.h"
-#include "gnugo.h"
 #include "hash.h"
 #include "gg_utils.h"
 
@@ -75,34 +74,6 @@ vgprintf(FILE *outputfile, const char *f
       {
        double f = va_arg(ap, double); /* passed as double, not float */
        fprintf(outputfile, "%.2f", f);
-       break;
-      }
-      case 'r':
-      {
-       int result = va_arg(ap, int);
-
-       switch (result) {
-       case 0:             
-         fprintf(outputfile, "%s", "0");
-         break;
-       case KO_B:          
-         fprintf(outputfile, "%s", "KO_B");
-         break;
-       case LOSS:          
-         fprintf(outputfile, "%s", "LOSS");
-         break;
-       case GAIN:          
-         fprintf(outputfile, "%s", "GAIN");
-         break;
-       case KO_A:          
-         fprintf(outputfile, "%s", "KO_A");
-         break;
-       case WIN:           
-         fprintf(outputfile, "%s", "WIN");
-         break;
-         
-       default:            fprintf(outputfile, "%s", "ERROR");
-       }
        break;
       }
       case 's':
Index: engine/value_moves.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/value_moves.c,v
retrieving revision 1.128
diff -u -p -r1.128 value_moves.c
--- engine/value_moves.c        25 May 2004 03:13:46 -0000      1.128
+++ engine/value_moves.c        2 Jun 2004 02:57:51 -0000
@@ -528,11 +528,11 @@ find_large_scale_owl_attack_moves(int co
                      && acode == WIN) {
                    add_owl_attack_move(pos, target, kworm, acode);
                     if (debug & DEBUG_LARGE_SCALE)
-                     gprintf("Move at %1m owl-attacks %1m on a large 
scale(%r).\n", 
-                             pos, target, acode);
+                     gprintf("Move at %1m owl-attacks %1m on a large 
scale(%s).\n", 
+                             pos, target, result_to_string(acode));
                   }
                   else if (debug & DEBUG_LARGE_SCALE)
-                    gprintf("Move at %1m isn't a clean large scale attack on 
%1m (%r).\n", pos, target, acode);
+                    gprintf("Move at %1m isn't a clean large scale attack on 
%1m (%r).\n", pos, target, result_to_string(acode));
                   
                   if (debug & DEBUG_LARGE_SCALE)
                    gprintf("  owl nodes used = %d, dist = %d\n", 




reply via email to

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