From 689d4bda4200571b46b0f4ae3b6c537ab8633557 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Thu, 14 Jan 2016 19:16:50 +0100 Subject: [PATCH] Use ii in Betza notation for 3rd-rank Pawn push The 'i' modifier specifies the move is only for virgin pieces. We now use 'ii' to indicate a move that can be made when the piece is standing on the square in front of that were such a piece starts in the initial setup. This is intended for Pawns that can still be pushed extra far after they have made a first single step, such as in Wildebeest Chess, where pawns on 2nd rank can move 1, 2 or 3 squares ahead, and on 3rd rank can still move 1 or 2 (fmWifmW3iifmW2). --- moves.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/moves.c b/moves.c index 1e9ba9e..0144486 100644 --- a/moves.c +++ b/moves.c @@ -287,7 +287,7 @@ MovesFromString (Board board, int flags, int f, int r, int tx, int ty, int angle while(*p) { // more moves to go int expo = 1, dx, dy, x, y, mode, dirSet, ds2=0, retry=0, initial=0, jump=1, skip = 0, all = 0; char *cont = NULL; - if(*p == 'i') initial = 1, desc = ++p; + while(*p == 'i') initial++, desc = ++p; while(islower(*p)) p++; // skip prefixes if(!isupper(*p)) return; // syntax error: no atom dx = xStep[*p-'A'] - '0';// step vector of atom @@ -372,6 +372,7 @@ MovesFromString (Board board, int flags, int f, int r, int tx, int ty, int angle if(isdigit(*++p)) expo = atoi(p++); // read exponent if(expo > 9) p++; // allow double-digit desc = p; // this is start of next move + if(initial == 2) { if(board[r][f] != initialPosition[r-2*his+3][f]) continue; } else if(initial && (board[r][f] != initialPosition[r][f] || r == 0 && board[TOUCHED_W] & 1<