1 import { ChessRules
} from "@/base_rules";
3 export class CrossingRules
extends ChessRules
{
6 return [ [[4, 0], [4, 8]] ];
11 const color
= V
.GetOppCol(this.turn
);
12 const secondHalf
= (color
== 'w' ? [0, 1, 2, 3] : [4, 5, 6, 7]);
13 if (secondHalf
.includes(this.kingPos
[color
][0]))
14 // Half-board is crossed
15 return color
== "w" ? "1-0" : "0-1";
16 return super.getCurrentScore();
21 let evaluation
= super.evalPosition();
22 // Ponder with king position:
25 Math
.abs(this.kingPos
["w"][0] - 3.5) -
26 Math
.abs(this.kingPos
["b"][0] - 3.5)