import { randInt, shuffle } from "@/utils/alea";
export class MakrukRules extends ChessRules {
+
static get HasFlags() {
return false;
}
return false;
}
+ static get Monochrome() {
+ return true;
+ }
+
+ static get Notoodark() {
+ return true;
+ }
+
static get PawnSpecs() {
return Object.assign(
{},
ChessRules.PawnSpecs,
- {
- twoSquares: false,
- promotions: [V.QUEEN]
- }
+ { promotions: [V.QUEEN] }
);
}
);
}
+ isAttacked(sq, color) {
+ return (
+ super.isAttacked(sq, color) || this.isAttackedByPromoted(sq, color)
+ );
+ }
+
isAttackedByBishop(sq, color) {
- const forward = (this.turn == 'w' ? 1 : -1);
+ const forward = (color == 'w' ? 1 : -1);
return this.isAttackedBySlideNJump(
sq,
color,
);
}
+ isAttackedByPromoted(sq, color) {
+ return super.isAttackedBySlideNJump(
+ sq,
+ color,
+ V.PROMOTED,
+ V.steps[V.BISHOP],
+ "oneStep"
+ );
+ }
+
static get VALUES() {
return {
p: 1,
k: 1000
};
}
+
};