From 9c55767f73b48da27bb4e0f2fdcd62545abde28c Mon Sep 17 00:00:00 2001 From: "H.G.Muller" Date: Thu, 16 Apr 2020 20:18:55 +0200 Subject: [PATCH] Don't always use UCI Cyclone dialect in Xiangqi Whether the Cyclone dialect is used (omitting 'position' and using 'r' for white-to-move in the FEN) is now determined by whether the engine is called with -c or without protocol specifier; in the latter case it uses standard UCI even in Xiangqi. --- UCI2WB.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/UCI2WB.c b/UCI2WB.c index 1799897..e636628 100644 --- a/UCI2WB.c +++ b/UCI2WB.c @@ -40,6 +40,7 @@ #define VARIANTS ",normal,xiangqi" #define STDVARS "chess,chess960,crazyhouse,3check,giveaway,suicide,losers,atomic,seirawan,shogi,xiangqi" #define EGT ",gaviotaTbPath,syzygyPath,nalimovPath,robbotripleBaseDirectory,robbototalBaseDirectory,bitbases path," +#define XQPOS "position fen rnbakabnr/9/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/9/RNBAKABNR" #define DPRINT if(debug) printf #define EPRINT(X) { char f[999]; sprintf X; DPRINT("%s", f); fprintf(toE, "%s", f + 2*(*f == '#')); /* strip optional # prefix */ } @@ -49,7 +50,7 @@ #define NONE 2 #define ANALYZE 3 -char move[2000][10], iniPos[256], hashOpt[20], suspended, ponder, post, hasHash, c, sc='c', suffix[81], varOpt, searching, *binary; +char move[2000][10], iniPos[256], hashOpt[20], suspended, ponder, post, hasHash, c, sc=' ', sc2, suffix[81], varOpt, searching, *binary; int mps, tc, inc, sTime, depth, myTime, hisTime, stm, computer = NONE, memory, oldMem=0, cores, moveNr, lastDepth, lastScore, startTime, debug, flob; int statDepth, statScore, statNodes, statTime, currNr, size, collect, nr, sm, inex, on[500], frc, byo = -1, namOpt, comp; char currMove[20], moveMap[500][10], /* for analyze mode */ canPonder[20], threadOpt[20], varList[8000], anaOpt[20], checkOptions[8192] = "Ponder"; @@ -138,7 +139,7 @@ int Play(int nr) { int i, last = -1; - FromFEN(iniPos + 4); // in XQ iniPos always has just "fen " prefix + FromFEN(iniPos + 13); // FEN part for(i=0; i 0) EPRINT((f, "# setoption name UCI_Chess960 value true\n")) } } else if(!strcmp(command, "undo") && (i=1) || !strcmp(command, "remove") && (i=2)) { @@ -756,7 +758,7 @@ main(int argc, char **argv) if(sc == 'x') nameWord = valueWord = bTime = "", wTime = "opp", bInc = "increment", wInc = "oppincrement", unit = 1000; // switch to UCCI keywords else if(sc == 'f' ) frc = -1, sc = 'c'; // UCI for unannounced Chess960 - else if(sc == 'n') sc = 'c'; // UCI for normal Chess + else if(sc != 's') sc2 = sc, sc = 'c'; // UCI for normal Chess // spawn engine proc if(StartEngine(binary = argv[1], dir) != NO_ERROR) { perror(argv[1]), exit(-1); } -- 2.11.4.GIT