bug-gnubg
[Top][All Lists]
Advanced

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

Re: [Bug-gnubg] Anomolous looking code in eval.c


From: Jim Segrave
Subject: Re: [Bug-gnubg] Anomolous looking code in eval.c
Date: Tue, 16 Jul 2002 17:19:11 +0200
User-agent: Mutt/1.2.5i

On Mon 15 Jul 2002 (18:37 +0000), Joern Thyssen wrote:
> On Mon, Jul 15, 2002 at 04:06:14PM +0200, Jim Segrave wrote


> CommandHint in gnubg.c is a good place to start.
> 
> For example, to evaluate cube decision you basically have to
> 
>    /* set-up internal cube info struct from current match state */
>    GetMatchStateCubeInfo ( &ci, &ms );
>     
>    /* Evaluate cube decision */
>    GeneralCubeDecisionE ( aarOutput, ms.anBoard, &ci, &esEvalCube.ec );
> 
>    cd = FindCubeDecision ( arDouble, aarOutput, &ci );
> 
> 
>    arDouble will now contain the equity for no double, double-take, and
>    double-pass, and cd indicates the correct cube action.
> 
> In the rest of CommandHint you can see code for determining resignations,
> take decisions, and chequer play decisions. It's relatively
> straightforward, but don't hesitate to ask if you have further
> questions. 
> 
> I've tried to implement something similar to a tutor-mode, but had some
> trouble with the GTK interface. While the program is analysing the human
> player's moves, GTK is "frozen", but remembers your mouse clicks, and goes
> totally bananas after finishing the analysis if you've clicked around
> while waiting for the analysis to finish.
> 
> My code for auto-analysis can be found in autoAnalyseMove in play.c

Thanks - that should be helpful. The remembered mouse-click issue is
just the sort of thing I needed to hear about. I guess I'd better read
up on the gtk documentation to see if there's some way to tell it to
drop unprocessed events or something. It probably would have caught
me, as I'm not ggod enough to really benefit from analyisis beyond 0
ply, which is more than fast enough on my machine, so I might not have
seen it at all.
 
> In the gamelist (Window->Game list) moves and cube decisions are marked
> with ! and ?. Unfortunately it's very difficult to use colorisations in
> the widget used for the game list with GTK 1.2. However, it should be
> fixed with GTK 2.0, so we might implement that soon. Also, on my todo
> list is a feature similar to snowie where you can skip forward to, e.g., 
> errors and blunders. I've uncommited code for the CLI commands, but need
> to figure out how to implement it in the GUI.

A skip to marked move would be a nice feature indeed.
 
> Let me know if you need write access to CVS, e.g., if you wish to make a
> branch where you can play around or wish to commit code to the main
> branch.

Thanks for the offer, but for now I'll just work against a frozen copy
on my machine. I don't know how much time I'll be able to devote to
this, it seems like it should be simple enough, as all the functions
for evaluation alredy exist, but one never knows. For the moment, I
can always see how difficult it will be to merge against the current
head of the tree. I suspect it would be better if I can get something
which appears to work and patches cleanly against the current source,
then pass it to you or another developer to look at before trying to
put anything into the main code. I'm not that confident that I
wouldn't break something or do things in a way that doesn't match the
current 'style' of the source, so I think any changes I might come up
with would want careful examination by someone more familiar with the
overall program.

-- 
Jim Segrave           address@hidden



reply via email to

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