From aaa4fed7c2baa1a417750d6f7bd23d6efa01b327 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Mon, 20 Jun 2011 23:53:49 +0200 Subject: [PATCH] Allow double-digit rank numbers The parser already understood double-digit numbers on input, and CoordsToAlgebraic produced them on otput. This patch also fixes sending of the moves to the computer, for which the moveList was used. The latter stored 10 as ':', etc,to always get a 4-char move, the characters of which were frequently being converted to fromY or toY by adding/subtracting ONE. To not break that the one-character encoding of rank number is kept in moveList, but in SendMoveToProgram, characters > '9' are converted to double digits. --- backend.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/backend.c b/backend.c index 6ad2142..2cbe2e0 100644 --- a/backend.c +++ b/backend.c @@ -4888,6 +4888,11 @@ SendMoveToProgram(moveNum, cps) else SendToProgram("O-O-O\n", cps); } else SendToProgram(moveList[moveNum], cps); + } else + if(BOARD_HEIGHT > 10) { // [HGM] big: convert ranks to double-digit where needed + snprintf(buf, MSG_SIZ, "%c%d%c%d%s", moveList[moveNum][0], moveList[moveNum][1] - '0', + moveList[moveNum][2], moveList[moveNum][3] - '0', moveList[moveNum]+4); + SendToProgram(buf, cps); } else SendToProgram(moveList[moveNum], cps); /* End of additions by Tord */ -- 1.7.0.4