fdecf0a49a8f5f3836047e58a6efc32763687b6c
1 import { ChessRules
} from "@/base_rules";
3 export class PawnsRules
extends ChessRules
{
9 static get PawnSpecs() {
13 // The promotion piece doesn't matter, the game is won
14 { promotions: [V
.QUEEN
] }
18 static get HasFlags() {
24 static GenRandInitFen() {
25 return "8/pppppppp/8/8/8/8/PPPPPPPP/8 w 0 -";
37 const oppCol
= V
.GetOppCol(this.turn
);
38 if (this.board
.some(b
=>
39 b
.some(cell
=> cell
[0] == oppCol
&& cell
[1] != V
.PAWN
))
41 return (oppCol
== 'w' ? "1-0" : "0-1");
43 if (!this.atLeastOneMove()) return "1/2";
50 static get SEARCH_DEPTH() {