projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add 'pacoplay mode' to Paco-Sako
[vchess.git]
/
client
/
src
/
variants
/
Twokings.js
diff --git
a/client/src/variants/Twokings.js
b/client/src/variants/Twokings.js
index
d56d095
..
b5f2b05
100644
(file)
--- a/
client/src/variants/Twokings.js
+++ b/
client/src/variants/Twokings.js
@@
-2,6
+2,7
@@
import { ChessRules } from "@/base_rules";
import { CoregalRules } from "@/variants/Coregal";
export class TwokingsRules extends CoregalRules {
import { CoregalRules } from "@/variants/Coregal";
export class TwokingsRules extends CoregalRules {
+
static get PawnSpecs() {
return Object.assign(
{},
static get PawnSpecs() {
return Object.assign(
{},
@@
-14,7
+15,7
@@
export class TwokingsRules extends CoregalRules {
if (position.length == 0) return false;
const rows = position.split("/");
if (rows.length != V.size.x) return false;
if (position.length == 0) return false;
const rows = position.split("/");
if (rows.length != V.size.x) return false;
- let kings = {
"w": 0, "b"
: 0 };
+ let kings = {
'K': 0, 'k'
: 0 };
for (let row of rows) {
let sumElts = 0;
for (let i = 0; i < row.length; i++) {
for (let row of rows) {
let sumElts = 0;
for (let i = 0; i < row.length; i++) {
@@
-54,8
+55,8
@@
export class TwokingsRules extends CoregalRules {
return squares;
}
return squares;
}
- static GenRandInitFen(
randomnes
s) {
- if (randomness == 0)
+ static GenRandInitFen(
option
s) {
+ if (
options.
randomness == 0)
return "rnqkkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNQKKBNR w 0 adehadeh -";
const replaceBishop = (fen, first, ch1, ch2) => {
return "rnqkkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNQKKBNR w 0 adehadeh -";
const replaceBishop = (fen, first, ch1, ch2) => {
@@
-83,7
+84,7
@@
export class TwokingsRules extends CoregalRules {
};
const fen =
};
const fen =
- CoregalRules.GenRandInitFen(
randomnes
s)
+ CoregalRules.GenRandInitFen(
option
s)
.replace("q", "k").replace("Q", "K");
// Now replace a bishop by the queen,
// so that bishops are of different colors:
.replace("q", "k").replace("Q", "K");
// Now replace a bishop by the queen,
// so that bishops are of different colors:
@@
-101,6
+102,11
@@
export class TwokingsRules extends CoregalRules {
);
}
);
}
+ getPotentialQueenMoves(sq) {
+ return this.getSlideNJumpMoves(sq,
+ V.steps[V.ROOK].concat(V.steps[V.BISHOP]));
+ }
+
underCheck(color) {
const oppCol = V.GetOppCol(color);
for (let i=0; i<V.size.x; i++) {
underCheck(color) {
const oppCol = V.GetOppCol(color);
for (let i=0; i<V.size.x; i++) {
@@
-123,4
+129,5
@@
export class TwokingsRules extends CoregalRules {
}
postUndo() {}
}
postUndo() {}
+
};
};