83ccca70d96636ae5883be12dfe6eac14e855ad3
1 import { ChessRules
} from "@/base_rules";
3 export class PawnsRules
extends ChessRules
{
4 static get PawnSpecs() {
8 // The promotion piece doesn't matter, the game is won
9 { promotions: [V
.QUEEN
] }
13 static get HasFlags() {
17 static GenRandInitFen() {
18 return "8/pppppppp/8/8/8/8/PPPPPPPP/8 w 0 -";
30 const oppCol
= V
.GetOppCol(this.turn
);
31 if (this.board
.some(b
=>
32 b
.some(cell
=> cell
[0] == oppCol
&& cell
[1] != V
.PAWN
))
34 return (oppCol
== 'w' ? "1-0" : "0-1");
36 if (!this.atLeastOneMove()) return "1/2";