94150c2817acda5c9c6490449878f9edf1ff79fa
1 import ChessRules
from "/base_rules.js";
3 export default class BrotherhoodRules
extends ChessRules
{
5 canTake([x1
, y1
], [x2
, y2
]) {
6 if (!super.canTake([x1
, y1
], [x2
, y2
]))
8 const p1
= this.getPiece(x1
, y1
),
9 p2
= this.getPiece(x2
, y2
);
10 return (p1
!= p2
|| ['p', 'k'].some(symb
=> [p1
, p2
].includes(symb
)));
14 if (this.atLeastOneMove(this.turn
))
17 return (this.turn
== 'w' ? "0-1" : "1-0");