From: H.G.Muller Date: Mon, 27 Oct 2014 22:59:02 +0000 (+0100) Subject: Implement UCCI X-Git-Tag: v2.0~17 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=792199f6616669de79a1b09644af1cea831be128;p=uci2wb.git Implement UCCI The main framework of UCCI now works, and is activated by the option -x : We send 'ucci' and expect 'ucciok', the alternative keywords for timing are used (time and opptime, increment and oppincrement), and 'name' and 'value' are suppressed when setting options. 'name' is also not mandatory anymore in the received 'option' commands. The position-moves command starts with the FEN for after the latest capture, and now has the 'position' keyword that was missing in Cyclone UCI. --- diff --git a/UCI2WB.c b/UCI2WB.c index bd8a4f8..21aad7d 100644 --- a/UCI2WB.c +++ b/UCI2WB.c @@ -132,6 +132,7 @@ StartSearch(char *ponder) int x = (ponder[0] != 0); // during ponder stm is the opponent int black = (stm == BLACK ^ x ^ sc == 's'); // set if our color is what the engine calls black int nr = moveNr + x; // we ponder for one move ahead! + if(sc == 'x') black = 1; // in UCCI 'black' refers to us and 'white' to opponent fprintf(toE, "\ngo%s %stime %d %stime %d", ponder, bTime, black ? myTime : hisTime, wTime, !black ? myTime : hisTime); DPRINT( "\n# go%s %stime %d %stime %d", ponder, bTime, black ? myTime : hisTime, wTime, !black ? myTime : hisTime); if(sTime > 0) { fprintf(toE, " movetime %d", sTime); DPRINT(" movetime %d", sTime); } else @@ -154,10 +155,16 @@ StopPonder(int pondering) void LoadPos(int moveNr) { - int j; - fprintf(toE, "%s moves", iniPos); - DPRINT( "# %s moves", iniPos); - for(j=0; j 2) dir = argv[2]; if(argc > 3) suffix = argv[3]; + if(sc == 'x') nameWord = valueWord = bTime = "", wTime = "opp", bInc = "increment", wInc = "oppincrement", unit = 1000; // switch to UCCI keywords + // spawn engine proc if(StartEngine(argv[1], dir) != NO_ERROR) { perror(argv[1]), exit(-1); }