From 855e92a4f54fc5d930d79736f4f425aa884c9c52 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Thu, 18 Dec 2014 15:11:31 +0100 Subject: [PATCH] Make some Bonanza commands available as CECP option The commands book on/off, book wide/narrow, resign N, hash learn on/off, and hash learn create are made available in XBoard mode as engine-defined options. --- proce.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/proce.c b/proce.c index 8556ef1..c7df52a 100644 --- a/proce.c +++ b/proce.c @@ -302,6 +302,13 @@ Out("# command = '%s'\n", line); Out("feature option=\"MultiPV -spin 1 1 100\"\n"); Out("feature option=\"centi-Pawn margin -spin 200 0 25000\"\n"); #endif + Out("feature option=\"Resign threshold -spin 1000 0 2000\"\n"); + Out("feature option=\"Create Learn File -button\"\n"); + Out("feature option=\"Learn -check 1\"\n"); + Out("feature option=\"Use book -check 1\"\n"); + Out("feature option=\"Book -combo wide /// narrow\"\n"); + Out("feature option=\"\"\n"); + Out("feature option=\"\"\n"); Out("feature variants=\"shogi\" usermove=1 myname=\"Bonanza " BNZ_VER "\" memory=1 smp=1 debug=1 colors=0 setboard=1 ping=1 sigint=0 exclude=1 done=1\n"); } @@ -324,8 +331,14 @@ Out("# command = '%s'\n", line); IF("variant") { /* ignore, since it must be Shogi */; } IF("setboard") { forceMode = 1; plyNr = 0; read_fen( line ); return 0; } IF("option") { + char buf[100]; if(sscanf(line+7, "MultiPV=%d", &value) == 1) { sprintf(line, "mpv num %d", value); return 0; } if(sscanf(line+7, "centi-Pawn margin=%d", &value) == 1) { sprintf(line, "mpv width %d", value); return 0; } + if(sscanf(line+7, "Resign threshold=%d", &value) == 1) { sprintf(line, "resign %d", value); return 0; } + if(sscanf(line+7, "Learn=%d", &value) == 1) { sprintf(line, "hash learn %s", value ? "on" : "off"); return 0; } + if(sscanf(line+7, "Create Learn File") == 1) { sprintf(line, "hash learn create"); return 0; } + if(sscanf(line+7, "Use book=%d", &value) == 1) { sprintf(line, "book %s", value ? "on" : "off"); return 0; } + if(sscanf(line+7, "Book=%s", buf) == 1) { sprintf(line, "book %s", buf); return 0; } } IF("level") { int min, sec; float fsec=0.; if(sscanf(line+6, "%d %d:%d %f", &movesPerSession, &min, &sec, &fsec) != 4) -- 1.7.0.4