From 4e49ba575342f4303001300e601272f386f46ee6 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Tue, 7 Feb 2017 20:04:42 +0100 Subject: [PATCH] Assign correct PST in all Shogi variants The available piece-square tables are now assigned dependent on the variant, where a new variant-idexed table of strings indicates which table goes with which piece. --- dropper.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/dropper.c b/dropper.c index 95b7608..c6821fc 100644 --- a/dropper.c +++ b/dropper.c @@ -356,6 +356,15 @@ char *ptc[] = { // XBoard 4.9 piece-to-char table "S.....F..........^F.P........^S....L........C......RKs.....f..........^f.p........^s....l........c......rk" }; +char *pstType[] = { + "", + "307716 777718", + "3077160 7777187", + "3077160 7777187", + "3055676777060100 77100787777801", + "770076 100001" +}; + typedef struct { int files, ranks, hand, zone; char *name; @@ -606,6 +615,8 @@ printf("# variant %d: %s\n", v, variants[v].name); rookPST[22*r+f] = rookPST[22*xr+f+11] = 45*(xr < zone); } + for(f=0,p=pstType[v]; *p; p++,f++) if(*p == ' ') f = 15; else PST[BLACK+f] = (PST[WHITE+f] = pstData + 22*11*(*p - '0')) + 11*(*p > '2'); + InitCaptureCodes(variants[v].codes); pinCodes = (v == 5 ? 0xFF2C : 0xFF1F); // rays along which pinning ispossible } -- 1.7.0.4