[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gnugo-devel] gnugo without computer
From: |
Gunnar Farneback |
Subject: |
Re: [gnugo-devel] gnugo without computer |
Date: |
Mon, 17 Mar 2003 22:41:54 +0100 |
User-agent: |
EMH/1.14.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.3 Emacs/20.7 (sparc-sun-solaris2.7) (with unibyte mode) |
Arend wrote:
> > gnugo_play_move(0,0,BLACK); /* first move */
> > showboard(0);
> > gnugo_play_move(3,2,WHITE);
> > showboard(0);
> > score_estimate=gnugo_estimate_score(score_upper,score_lower)
> >
> > causes a Segmentation Fault.
>
> I think you need to call silent_examine_position(...) before calling
> gnugo_estimate_score(...).
>
> You can peek at gtp_estimate_score() in play_gtp.c for how this works.
That's correct, but gnugo_estimate_score() really should be
self-contained. Otherwise there's not much point with the gnugo_*
stuff. Actually I'm not convinced there's all that much point anyway,
but that's another question.
Appended patch should solve the problem.
/Gunnar
Index: engine/interface.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/interface.c,v
retrieving revision 1.38
diff -u -r1.38 interface.c
--- engine/interface.c 18 Jan 2003 03:05:31 -0000 1.38
+++ engine/interface.c 17 Mar 2003 21:37:37 -0000
@@ -335,6 +335,7 @@
float
gnugo_estimate_score(float *upper, float *lower)
{
+ silent_examine_position(WHITE, EXAMINE_DRAGONS);
return estimate_score(upper, lower);
}