From 072fa231f1280012bcee0582c14b5b542db083e5 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Wed, 28 Dec 2016 15:17:18 +0100 Subject: [PATCH] Make variants also accessible through systematic names The engine-defined variants are now also announced as 5x5+5_shogi etc., and such names are matched based on the board parameters in the variant- definition table. --- dropper.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dropper.c b/dropper.c index 726c1e8..31df0fa 100644 --- a/dropper.c +++ b/dropper.c @@ -416,9 +416,12 @@ void GameInit (char *name) { int v, *ip, i, color, r, f, zone; - unsigned char *moves, *codes; + unsigned char *moves, *codes; char c; // determine variant parameters + if(sscanf(name, "%dx%d+%d_%c", &f, &r, &i, &c) == 4) { + for(v=6; --v>0; ) if(variants[v].files == f && variants[v].ranks == r && variants[v].hand == i) break; + } else for(v=6; --v>0;) if(!strcmp(name, variants[v].name)) break; printf("# variant %d: %s\n", v, variants[v].name); nrFiles = variants[v].files; @@ -1490,7 +1493,8 @@ printf("# command: %s\n", inBuf); } if(!strcmp(command, "protover")){ printf("feature ping=1 setboard=1 colors=0 usermove=1 memory=1 debug=1 reuse=0 sigint=0 sigterm=0 myname=\"CrazyWa " VERSION "\"\n"); - printf("feature variants=\"crazyhouse,shogi,minishogi,judkinshogi,torishogi,euroshogi,crazywa\"\n"); + printf("feature variants=\"crazyhouse,shogi,minishogi,judkinshogi,torishogi,euroshogi,crazywa," + "5x5+5_shogi,6x6+6_shogi,7x7+6_shogi,11x11+16_shogi,8x8+6_crazyhouse,8x8+7_crazyhouse\"\n"); printf("feature option=\"Resign -check 0\"\n"); // example of an engine-defined option printf("feature option=\"Contempt -spin 0 -200 200\"\n"); // and another one printf("feature done=1\n"); -- 1.7.0.4