projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve Paco-Sako rules. Draft Isardam
[vchess.git]
/
client
/
src
/
variants
/
Hamilton.js
diff --git
a/client/src/variants/Hamilton.js
b/client/src/variants/Hamilton.js
index
6794e72
..
88f6713
100644
(file)
--- a/
client/src/variants/Hamilton.js
+++ b/
client/src/variants/Hamilton.js
@@
-2,6
+2,7
@@
import { ChessRules, Move, PiPo } from "@/base_rules";
import { randInt } from "@/utils/alea";
export class HamiltonRules extends ChessRules {
import { randInt } from "@/utils/alea";
export class HamiltonRules extends ChessRules {
+
static get HasFlags() {
return false;
}
static get HasFlags() {
return false;
}
@@
-50,7
+51,7
@@
export class HamiltonRules extends ChessRules {
for (let i = 0; i < row.length; i++) {
if (['x'].concat(V.PIECES).includes(row[i].toLowerCase())) sumElts++;
else {
for (let i = 0; i < row.length; i++) {
if (['x'].concat(V.PIECES).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;
}
@@
-158,4
+159,5
@@
export class HamiltonRules extends ChessRules {
// First game move:
return "N@" + V.CoordsToSquare(move.end);
}
// First game move:
return "N@" + V.CoordsToSquare(move.end);
}
+
};
};