From: H.G. Muller Date: Sun, 16 Jun 2013 15:54:31 +0000 (+0200) Subject: Build in limited EPD capability for engine fingerprintig X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=cf736a0286ed40b6e671e77fd080812edd75f80b;p=xboard.git Build in limited EPD capability for engine fingerprintig The new option -finger FILENAME causes games to end after the first move, where the initial position plus the move will then be written to the specified file in EPD format. This can be used in match mode with a set of start positions or opening lines to record the best moves of an engine on a set of positions (as in CSVN fingerprinting). --- diff --git a/args.h b/args.h index 8c52303..01dc439 100644 --- a/args.h +++ b/args.h @@ -597,6 +597,7 @@ ArgDescriptor argDescriptors[] = { { "useBorder", ArgBoolean, (void *) &appData.useBorder, TRUE, (ArgIniType) FALSE }, { "ub", ArgBoolean, (void *) &appData.useBorder, FALSE, INVALID }, { "border", ArgFilename, (void *) &appData.border, TRUE, (ArgIniType) "" }, + { "finger", ArgFilename, (void *) &appData.finger, FALSE, (ArgIniType) "" }, // [HGM] tournament options { "tourneyFile", ArgFilename, (void *) &appData.tourneyFile, FALSE, (ArgIniType) "" }, diff --git a/backend.c b/backend.c index efe3b0e..2156091 100644 --- a/backend.c +++ b/backend.c @@ -8305,6 +8305,17 @@ FakeBookMove: // [HGM] book: we jump here to simulate machine moves after book h MakeMove(fromX, fromY, toX, toY, promoChar);/*updates forwardMostMove*/ + /* Test suites abort the 'game' after one move */ + if(*appData.finger) { + static FILE *f; + char *fen = PositionToFEN(backwardMostMove, NULL, 0); // no counts in EPD + if(!f) f = fopen(appData.finger, "w"); + if(f) fprintf(f, "%s bm %s;\n", fen, parseList[backwardMostMove]), fflush(f); + else { DisplayFatalError("Bad output file", errno, 0); return; } + free(fen); + GameEnds(GameUnfinished, NULL, GE_XBOARD); + } + /* [AS] Adjudicate game if needed (note: remember that forwardMostMove now points past the last move) */ if( gameMode == TwoMachinesPlay && adjudicateLossThreshold != 0 && forwardMostMove >= adjudicateLossPlies ) { int count = 0; diff --git a/common.h b/common.h index 049d428..d56dbf9 100644 --- a/common.h +++ b/common.h @@ -657,6 +657,7 @@ typedef struct { char *serverFileName; char *serverMovesName; + char *finger; Boolean suppressLoadMoves; int serverPause; int timeOdds[ENGINES];