import { ArrayFun } from "@/utils/array";
import { randInt } from "@/utils/alea";
-export class DoubleordaRules extends OrdaRules {
+export class OrdamirrorRules extends OrdaRules {
+
static get PawnSpecs() {
return Object.assign(
{},
return "Orda/" + b;
}
- static GenRandInitFen(randomness) {
- if (randomness == 0)
+ static GenRandInitFen(options) {
+ if (options.randomness == 0)
return "lhafkahl/8/pppppppp/8/8/PPPPPPPP/8/LHAFKAHL w 0 ah -";
let pieces = { w: new Array(8), b: new Array(8) };
// Shuffle pieces on first (and last rank if randomness == 2)
for (let c of ["w", "b"]) {
- if (c == 'b' && randomness == 1) {
+ if (c == 'b' && options.randomness == 1) {
pieces['b'] = pieces['w'];
break;
}
getPotentialFalconMoves(sq) {
const onlyMoves = this.getSlideNJumpMoves(
- sq,
- V.steps[V.ROOK].concat(V.steps[V.BISHOP]),
- null,
- { onlyMove: true }
- );
+ sq, V.steps[V.ROOK].concat(V.steps[V.BISHOP]), null, { onlyMove: true });
const onlyTakes = this.getSlideNJumpMoves(
- sq,
- V.steps[V.KNIGHT],
- "oneStep",
- { onlyTake: true }
- );
+ sq, V.steps[V.KNIGHT], "oneStep", { onlyTake: true });
return onlyMoves.concat(onlyTakes);
}
isAttackedByFalcon(sq, color) {
return this.isAttackedBySlideNJump(
- sq, color, V.FALCON, V.steps[V.KNIGHT], "oneStep");
+ sq, color, V.FALCON, V.steps[V.KNIGHT], 1);
}
static get VALUES() {
k: 1000
};
}
+
};