"Protect your pawns": "Protect your pawns",
"Push and pull": "Push and pull",
"Queen disguised as a pawn": "Queen disguised as a pawn",
+ "Queen versus pawns": "Queen versus pawns",
"Reach the last rank (v1)": "Reach the last rank (v1)",
"Reach the last rank (v2)": "Reach the last rank (v2)",
"Reposition pieces": "Reposition pieces",
"Protect your pawns": "Protege tus peones",
"Push and pull": "Empujar y tirar",
"Queen disguised as a pawn": "Reina disfrazada de peón",
+ "Queen versus pawns": "Dama contra peones",
"Reach the last rank (v1)": "Llegar a la última fila (v1)",
"Reach the last rank (v2)": "Llegar a la última fila (v2)",
"Reposition pieces": "Reposicionar las piezas",
"Protect your pawns": "Protégez vos pions",
"Push and pull": "Pousser et tirer",
"Queen disguised as a pawn": "Reine déguisée en pion",
+ "Queen versus pawns": "Dame contre pions",
"Reach the last rank (v1)": "Atteignez la dernière rangée (v1)",
"Reach the last rank (v2)": "Atteignez la dernière rangée (v2)",
"Reposition pieces": "Replacer les pièces",
p
a(href="https://dames-cachees.herokuapp.com/rules") This website
- | introduces the rules and allow to play in live,
+ | developed by Etienne Orieux (2019)
+ | introduces the rules and allow to play in live,
| with a deterministic initial position but a user-defined
| location of the hiden queen.
-
-p
- a(href="https://github.com/orieuxe") Inventor
- | - see the repo "dames-cachees" - (2019)
p
a(href = "https://dames-cachees.herokuapp.com/rules") Este sitio web
- | presenta las reglas y te permite jugar en vivo,
+ | desarrollado por Etienne Orieux (2019)
+ | presenta las reglas y te permite jugar en vivo,
| con una posición inicial determinista pero dejando elegir
| la ubicación de la dama escondida
-
-p
- a(href="https://github.com/orieuxe") Inventor
- | - ver el repo "dames-cachees" - (2019)
p
a(href="https://dames-cachees.herokuapp.com/rules") Ce site web
- | présente les règles et permet de jouer en direct,
+ | développé par Etienne Orieux (2019)
+ | présente les règles et permet de jouer en direct,
| avec une position initiale déterministe mais en laissant choisir
| l'emplacement de la dame cachée.
-
-p
- a(href="https://github.com/orieuxe") Inventeur
- | - voir le repo "dames-cachees" - (2019)
--- /dev/null
+p.boxed
+ | A queen versus eight pawns.
+
+figure.diagram-container
+ .diagram
+ | fen:3q4/8/8/8/8/8/PPPPPPPP/8:
+ figcaption Initial position
+
+p.
+ The pawns win if one reaches the other end
+ without being immediately captured.
+ The queen wins if it captures all the pawns.
+
+h3 Source
+
+p
+ | Inspired by
+ a(href="https://chessplus.net/interactive-games/")
+ | Bishop vs 3 Pawns
+ | on chessplus.net.
--- /dev/null
+p.boxed
+ | Una dama contra ocho peones.
+
+figure.diagram-container
+ .diagram
+ | fen:3q4/8/8/8/8/8/PPPPPPPP/8:
+ figcaption Posición inicial
+
+p.
+ Los peones ganan si uno de ellos llega al otro lado sin ser
+ inmediatamente capturado.
+ La dama gana si se come todos los peones.
+
+h3 Fuente
+
+p
+ | Inspirado por
+ a(href="https://chessplus.net/interactive-games/")
+ | Bishop vs 3 Pawns
+ | en chessplus.net.
--- /dev/null
+p.boxed
+ | Une dame contre huit pions.
+
+figure.diagram-container
+ .diagram
+ | fen:3q4/8/8/8/8/8/PPPPPPPP/8:
+ figcaption Position initiale
+
+p.
+ Les pions gagnent si l'un d'eux arrive de l'autre côté sans être
+ immédiatement capturé.
+ La dame gagne si elle mange tous les pions.
+
+h3 Source
+
+p
+ | Inspiré par
+ a(href="https://chessplus.net/interactive-games/")
+ | Bishop vs 3 Pawns
+ | sur chessplus.net.
}
// Did a black pawn promote? Can the bishop take it?
const qIdx = this.board[7].findIndex(cell => cell[1] == V.QUEEN);
- if (qIdx >= 0 && !super.isAttackedByBishop([7, qIdx], 'w'))
+ if (
+ qIdx >= 0 &&
+ (this.turn == 'b' || !super.isAttackedByBishop([7, qIdx], 'w'))
+ ) {
return "0-1";
+ }
if (!this.atLeastOneMove()) return "1/2";
return "*";
}
if (this.board.every(b => b.every(cell => !cell || cell[0] != c)))
return (c == 'w' ? "0-1" : "1-0");
}
- // Did a black pawn promote? Can the rook take it?
+ // Did a black pawn promote? Can the knight take it?
const qIdx = this.board[7].findIndex(cell => cell[1] == V.QUEEN);
- if (qIdx >= 0 && !super.isAttackedByKnight([7, qIdx], 'w'))
+ if (
+ qIdx >= 0 &&
+ (this.turn == 'b' || !super.isAttackedByKnight([7, qIdx], 'w'))
+ ) {
return "0-1";
+ }
if (!this.atLeastOneMove()) return "1/2";
return "*";
}
--- /dev/null
+import { ChessRules } from "@/base_rules";
+
+export class QueenpawnsRules extends ChessRules {
+ static get PawnSpecs() {
+ return Object.assign(
+ {},
+ ChessRules.PawnSpecs,
+ // The promotion piece doesn't matter, the game is won
+ { promotions: [V.QUEEN] }
+ );
+ }
+
+ static get HasFlags() {
+ return false;
+ }
+
+ scanKings() {}
+
+ static GenRandInitFen() {
+ return "3q4/8/8/8/8/8/PPPPPPPP/8 w 0 -";
+ }
+
+ filterValid(moves) {
+ return moves;
+ }
+
+ getCheckSquares() {
+ return [];
+ }
+
+ getCurrentScore() {
+ // If all pieces of some color vanished, the opponent wins:
+ for (let c of ['w', 'b']) {
+ if (this.board.every(b => b.every(cell => !cell || cell[0] != c)))
+ return (c == 'w' ? "0-1" : "1-0");
+ }
+ // Did a white pawn promote? Can the queen (in turn) take it?
+ const qIdx = this.board[0].findIndex(cell => cell == "wq");
+ if (
+ qIdx >= 0 &&
+ (this.turn == 'w' || !super.isAttackedByQueen([0, qIdx], 'b'))
+ ) {
+ return "1-0";
+ }
+ if (!this.atLeastOneMove()) return "1/2";
+ return "*";
+ }
+
+ postPlay() {}
+ postUndo() {}
+
+ static get SEARCH_DEPTH() {
+ return 4;
+ }
+};
}
// Did a black pawn promote? Can the rook take it?
const qIdx = this.board[7].findIndex(cell => cell[1] == V.QUEEN);
- if (qIdx >= 0 && !super.isAttackedByRook([7, qIdx], 'w'))
+ if (
+ qIdx >= 0 &&
+ (this.turn == 'b' || !super.isAttackedByRook([7, qIdx], 'w'))
+ ) {
return "0-1";
+ }
if (!this.atLeastOneMove()) return "1/2";
return "*";
}
('Perfect', 'Powerful pieces'),
('Pocketknight', 'Knight in pocket'),
('Progressive', 'Play more and more moves'),
+ ('Queenpawns', 'Queen versus pawns'),
('Racingkings', 'Kings cross the 8x8 board'),
('Rampage', 'Move under cover'),
('Rifle', 'Shoot pieces'),