projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Early draft of TitanChess
[vchess.git]
/
client
/
src
/
variants
/
Cannibal.js
diff --git
a/client/src/variants/Cannibal.js
b/client/src/variants/Cannibal.js
index
f7a9514
..
bd5524f
100644
(file)
--- a/
client/src/variants/Cannibal.js
+++ b/
client/src/variants/Cannibal.js
@@
-49,7
+49,7
@@
export class CannibalRules extends ChessRules {
else if (kingWhiteCodes.includes(row[i])) kings['w']++;
if (allPiecesCodes.includes(row[i].toLowerCase())) sumElts++;
else {
else if (kingWhiteCodes.includes(row[i])) kings['w']++;
if (allPiecesCodes.includes(row[i].toLowerCase())) sumElts++;
else {
- const num = parseInt(row[i]);
+ const num = parseInt(row[i]
, 10
);
if (isNaN(num)) return false;
sumElts += num;
}
if (isNaN(num)) return false;
sumElts += num;
}
@@
-74,7
+74,7
@@
export class CannibalRules extends ChessRules {
const color = (piece.charCodeAt(0) <= 90 ? 'w' : 'b');
this.kingPos[color] = [i, k];
} else {
const color = (piece.charCodeAt(0) <= 90 ? 'w' : 'b');
this.kingPos[color] = [i, k];
} else {
- const num = parseInt(rows[i].charAt(j));
+ const num = parseInt(rows[i].charAt(j)
, 10
);
if (!isNaN(num)) k += num - 1;
}
k++;
if (!isNaN(num)) k += num - 1;
}
k++;
@@
-88,7
+88,7
@@
export class CannibalRules extends ChessRules {
return moves.filter(m => m.vanish.length == 2 && m.appear.length == 1);
}
return moves.filter(m => m.vanish.length == 2 && m.appear.length == 1);
}
-
// Stop at the first capture found (if any)
+ // Stop at the first capture found (if any)
atLeastOneCapture() {
const color = this.turn;
const oppCol = V.GetOppCol(color);
atLeastOneCapture() {
const color = this.turn;
const oppCol = V.GetOppCol(color);