- const color = this.getColor(x1, y1);
- const firstCodes = (color == 'w' ? [65, 97] : [97, 65]);
- const cpCapt = this.board[capt[0]][capt[1]];
- let count1 = [cp1.charCodeAt(0) - firstCodes[0], -1];
- if (cp1[1] != '@')
- count1[1] = cp1.charCodeAt(1) - firstCodes[0];
- let countC = [cpCapt.charCodeAt(0) - firstCodes[1], -1];
- if (cpCapt[1] != '@')
- countC[1] = cpCapt.charCodeAt(1) - firstCodes[1];
- count1[1]++;
- countC[0]--;
- let colorChange = false,
- captVanish = false;
- if (countC[0] < 0) {
- if (countC[1] >= 0) {
- colorChange = true;
- countC = [countC[1], -1];
- }
- else
- captVanish = true;
- }
- const incPrisoners = String.fromCharCode(firstCodes[0] + count1[1]);
+ const numCol1 = V.CharToNum(this.board[x1][y1]),
+ numColC = V.CharToNum(this.board[capt[0]][capt[1]]);