75665a541a0ce9e3c816ceba1697b4ceaea09026
1 import ChessRules
from "/base_rules.js";
3 export default class CrossingRules
extends ChessRules
{
6 let svg
= super.getSvgChessboard();
9 '<line x1="0" y1="40" x2="80" y2="40" ' +
10 'style="stroke:black;stroke-width:0.2"/></svg>'
14 getCurrentScore(move_s
) {
15 const res
= super.getCurrentScore(move_s
);
19 const color
= V
.GetOppTurn(this.turn
);
20 const secondHalf
= (color
== 'w' ? [0, 1, 2, 3] : [4, 5, 6, 7]);
21 for (let move of move_s
) {
23 move.appear
.length
>= 1 &&
24 move.appear
[0].p
== 'k' &&
25 secondHalf
.includes(move.appear
[0].x
)
27 // Half-board is crossed
28 return color
== "w" ? "1-0" : "0-1";