bug-gnubg
[Top][All Lists]
Advanced

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

[Bug-gnubg] How would I do this?


From: Jim Segrave
Subject: [Bug-gnubg] How would I do this?
Date: Mon, 12 Aug 2002 21:20:42 +0200
User-agent: Mutt/1.2.5i

I was playing with the idea of having a command which would do an
CommandAnalyzeMove() for any 'marked' move. This would be for those
who do a quick analysis of a game to find the serious errors. Then
you'd set a better analysis and run 'Anlyse marked' to re-evaluate all
the marked moves to get a better indication of what was wrong/how
wrong it was. I realise that some moves which weren't marked at all
with a say, 0 ply analysis, would not be handled by this method, but
still it might be useful.

I tried using the CommandAnalyzeMatch code and the underlying
AnalyzeMatch function as a model, but it doesn't work correctly. I
assume when skipping through the move list to the next move to
analyse, I'm not setting some portion of the state needed for
AnalyzeMove to function correctly. So the re-analysis is not, as far
as I can see, actually re-analysing the move I think it is.

What I tried was (leaving out the odds end ends necessary to make this
a command in gnubg.c and gtkgame.c and so forth:

extern void CommandAnalyseMarked (char *sz) {

    list        *pl;
    moverecord *pmr;
    matchstate msx;
        int             nMoves;

        if( !plGame ) {
          outputl( _("No game is being played.") );
          return;
        }

        if( CheckSettings() )
          return;

        nMoves = NumberMovesGame ( plGame );

        ProgressStartValue( _("Analysing marked moves; move:"), nMoves );

        for( pl = plGame->plNext; pl != plGame; pl = pl->plNext ) {

          pmr = pl->p;
          ProgressValueAdd( 1 );
          if (MoveIsMarked (pmr)) {
                memcpy ( &msx, &ms, sizeof ( matchstate ) );
                if( AnalyzeMove ( pmr, &msx, NULL,
                                                        &esAnalysisChequer,
                                                        &esAnalysisCube, FALSE 
) < 0 ) 
                        break;
          }
#if USE_GTK
          if( fX )
                GTKUpdateAnnotations();
#endif
        }
        
        ProgressEnd();

          
}                       


Is there a simple description of what has to be done when selecting a
move from the list in order to make my call to AnalyzeMove() function 
correctly? 

Also, does anyone have any idea what the problem is with the Makefiles
generated from current sources not including some needed libraries
when linking makeweights which I reported earlier today?

-- 
Jim Segrave           address@hidden




reply via email to

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