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

Re: computer-go: Perl Module for next move.



Jan van der Steen wrote:

> I tried this feature but the program core dumped.
> Inspecting things with gdb it seems the program
> expects TW[] and TB[] properties in the SGF file?
> Oh, another thing, the program wanted a GM[1]
> property in the file. Why is that?

You are misunderstanding what's happening here. GNU Go
isn't trying to read an sgf file. Indeed, your file has
already been read and parsed. At the point of the crash
GNU Go is trying to create one. In GNU Go 2.6, this
code works correctly and if gnugo -l [filename] --score last
is called without specifying an analyzer file it just 
reports the score. 

However changes to the sgf code in 2.7.132 broke this.
2.7.131 was the last version which doesn't crash on
--score last or --score [movenum].

We haven't been using the analyzer file but there is still
an evident demand for --score. The enclose patch fixes
these options by simply backing out all the sgf stuff and
just reporting the answer to stdout.

Dan


diff -u -N -r -x *.info* -x *Makefile* ./interface/play_solo.c ../gnugo-2.7.239/gnugo-2.7.238/interface/play_solo.c
--- ./interface/play_solo.c	Sun May 27 02:35:30 2001
+++ ../gnugo-2.7.239/gnugo-2.7.238/interface/play_solo.c	Tue Jun  5 03:21:23 2001
@@ -280,9 +280,8 @@
     return;
 
   move_val = genmove_conservative(&i, &j, next);
-  sgfAnalyzer(tree->lastnode, move_val);
   score = terri_eval[BLACK] - terri_eval[WHITE] - komi;
-  sprintf(text,
+  fprintf(stdout,
 "Black moyo: %3i\n\
 White moyo: %3i\n\
 Black territory: %3i\n\
@@ -296,12 +295,6 @@
 	  gameinfo->position.black_captured,
 	  (score>0) ? ("BLACK") : ((score<0) ? ("WHITE") : ("NOBODY")),
 	  (score<0) ? (-1*score) : (score));
-  if (strcmp(untilstr, "last"))
-      sgftreeSetLastNode(tree, sgftreeStartVariant(tree, 0));
-  sgfShowMoyo(tree->lastnode, SGF_SHOW_COLOR, 0);
-  sgfAddComment(tree->lastnode, text);
-  sgffile_write_comment(text);
-  fputs(text, stdout);
 }