projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Pandemonium (pawn drop)
[vchess.git]
/
client
/
src
/
variants
/
Royalrace.js
diff --git
a/client/src/variants/Royalrace.js
b/client/src/variants/Royalrace.js
index
346ca5f
..
5d5992c
100644
(file)
--- a/
client/src/variants/Royalrace.js
+++ b/
client/src/variants/Royalrace.js
@@
-2,7
+2,8
@@
import { ChessRules } from "@/base_rules";
import { ArrayFun } from "@/utils/array";
import { randInt, shuffle } from "@/utils/alea";
import { ArrayFun } from "@/utils/array";
import { randInt, shuffle } from "@/utils/alea";
-export const VariantRules = class RoyalraceRules extends ChessRules {
+export class RoyalraceRules extends ChessRules {
+
static get HasFlags() {
return false;
}
static get HasFlags() {
return false;
}
@@
-19,9
+20,13
@@
export const VariantRules = class RoyalraceRules extends ChessRules {
return { x: 11, y: 11 };
}
return { x: 11, y: 11 };
}
+ getPpath(b) {
+ return (b[1] == V.KNIGHT ? "Enpassant/" : "") + b;
+ }
+
static GenRandInitFen(randomness) {
if (randomness == 0)
static GenRandInitFen(randomness) {
if (randomness == 0)
- return "
11/11/11/11/11/11/11/11/11
/qrbnp1PNBRQ/krbnp1PNBRK w 0";
+ return "
92/92/92/92/92/92/92/92/92
/qrbnp1PNBRQ/krbnp1PNBRK w 0";
let pieces = { w: new Array(10), b: new Array(10) };
// Shuffle pieces on first and second rank
let pieces = { w: new Array(10), b: new Array(10) };
// Shuffle pieces on first and second rank
@@
-92,7
+97,7
@@
export const VariantRules = class RoyalraceRules extends ChessRules {
const whiteFen = pieces["w"].join("").toUpperCase();
const blackFen = pieces["b"].join("");
return (
const whiteFen = pieces["w"].join("").toUpperCase();
const blackFen = pieces["b"].join("");
return (
- "
11/11/11/11/11/11/11/11/11
/" +
+ "
92/92/92/92/92/92/92/92/92
/" +
blackFen.substr(5).split("").reverse().join("") +
"1" +
whiteFen.substr(5).split("").join("") +
blackFen.substr(5).split("").reverse().join("") +
"1" +
whiteFen.substr(5).split("").join("") +
@@
-133,15
+138,6
@@
export const VariantRules = class RoyalraceRules extends ChessRules {
return this.getSlideNJumpMoves(sq, V.steps[V.KNIGHT]);
}
return this.getSlideNJumpMoves(sq, V.steps[V.KNIGHT]);
}
- // What are the king moves from square x,y ?
- getPotentialKingMoves(sq) {
- return this.getSlideNJumpMoves(
- sq,
- V.steps[V.ROOK].concat(V.steps[V.BISHOP]),
- "oneStep"
- );
- }
-
filterValid(moves) {
if (moves.length == 0) return [];
const color = this.turn;
filterValid(moves) {
if (moves.length == 0) return [];
const color = this.turn;
@@
-224,4
+220,5
@@
export const VariantRules = class RoyalraceRules extends ChessRules {
V.CoordsToSquare(move.end)
);
}
V.CoordsToSquare(move.end)
);
}
+
};
};