projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add 'Connect' variant
[vchess.git]
/
client
/
src
/
variants
/
Antiking2.js
diff --git
a/client/src/variants/Antiking2.js
b/client/src/variants/Antiking2.js
index
2dad5e4
..
df76458
100644
(file)
--- a/
client/src/variants/Antiking2.js
+++ b/
client/src/variants/Antiking2.js
@@
-3,6
+3,7
@@
import { ArrayFun } from "@/utils/array";
import { randInt } from "@/utils/alea";
export class Antiking2Rules extends ChessRules {
import { randInt } from "@/utils/alea";
export class Antiking2Rules extends ChessRules {
+
static get ANTIKING() {
return "a";
}
static get ANTIKING() {
return "a";
}
@@
-43,7
+44,7
@@
export class Antiking2Rules extends ChessRules {
this.antikingPos["w"] = [i, k];
break;
default: {
this.antikingPos["w"] = [i, k];
break;
default: {
- const num = parseInt(rows[i].charAt(j));
+ const num = parseInt(rows[i].charAt(j)
, 10
);
if (!isNaN(num)) k += num - 1;
}
}
if (!isNaN(num)) k += num - 1;
}
}
@@
-117,7
+118,8
@@
export class Antiking2Rules extends ChessRules {
return res;
}
return res;
}
- getCheckSquares(color) {
+ getCheckSquares() {
+ const color = this.turn;
let res = [];
const oppCol = V.GetOppCol(color);
if (this.isAttacked(this.kingPos[color], oppCol))
let res = [];
const oppCol = V.GetOppCol(color);
if (this.isAttacked(this.kingPos[color], oppCol))
@@
-231,4
+233,5
@@
export class Antiking2Rules extends ChessRules {
static get SEARCH_DEPTH() {
return 2;
}
static get SEARCH_DEPTH() {
return 2;
}
+
};
};