import { ChessRules, Move, PiPo } from "@/base_rules";
export class Checkered2Rules extends ChessRules {
+
static board2fen(b) {
const checkered_codes = {
p: "s",
postPlay(move) {
super.postPlay(move);
// Does this move turn off a 2-squares pawn flag?
- if ([1, 6].includes(move.start.x) && move.vanish[0].p == V.PAWN)
+ if (
+ [1, 6].includes(move.start.x) &&
+ move.vanish[0].p == V.PAWN &&
+ Math.abs(move.end.x - move.start.x) == 2
+ ) {
this.pawnFlags[move.start.x == 6 ? "w" : "b"][move.start.y] = false;
+ }
this.cmoves.push(this.getCmove(move));
}
notation += "=" + move.appear[0].p.toUpperCase();
return notation;
}
+
};