From 9ab6e3faf717202a5ce807808975a4c29711a8e5 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Thu, 4 Oct 2018 11:06:52 +0200 Subject: [PATCH] Implement extended UCI info string variant option To allow UCI engines to also define variants with different board size and parent variant, an extended version of the info-string-variant command is recognized. This can also incluse 'files', 'ranks', 'pocket' and 'template' fields. The default values for these are 8, 8, 0 and "fairy", so that we remain compatible with the old info-string-variant command when the new fields are absent. --- UCI2WB.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/UCI2WB.c b/UCI2WB.c index 4f7fb9d..9d568f7 100644 --- a/UCI2WB.c +++ b/UCI2WB.c @@ -302,7 +302,15 @@ Engine2GUI() char *pv, varName[80]; if(sscanf(line+5, "string times @ %c", &dummy) == 1) { printf("# %s", line+12); continue; } if(sscanf(line+5, "string variant %s", varName) == 1) { - if(!strstr(STDVARS, varName) && (p = strstr(line+18, " startpos "))) printf("setup (-) 8x8+0_fairy %s", p+10); + if(!strstr(STDVARS, varName)) { + int files = 8, ranks = 8, hand = 0; char parent[80]; + if(p = strstr(line+18, " files ")) sscanf(p+7, "%d", &files); + if(p = strstr(line+18, " ranks ")) sscanf(p+7, "%d", &ranks); + if(p = strstr(line+18, " pocket ")) sscanf(p+8, "%d", &hand); + if(p = strstr(line+18, " template ")) sscanf(p+10, "%s", parent); else strcpy(parent, "fairy"); + if(p = strstr(line+18, " startpos ")) + printf("setup (-) %dx%d+%d_%s %s", files, ranks, hand, parent, p+10); + } continue; } if(collect && (pv = strstr(line+5, "currmove "))) { -- 1.7.0.4