From: Benjamin Auder Date: Sat, 26 Dec 2020 10:40:06 +0000 (+0100) Subject: Fix typo, add draft new variant (Lostqueen, to be edited) X-Git-Url: https://git.auder.net/DESCRIPTION?a=commitdiff_plain;h=955fbf56ea524b1a219d50b58ba1cae14e59b884;p=vchess.git Fix typo, add draft new variant (Lostqueen, to be edited) --- diff --git a/client/src/translations/rules/Lostqueen/en.pug b/client/src/translations/rules/Lostqueen/en.pug new file mode 100644 index 00000000..c3a59204 --- /dev/null +++ b/client/src/translations/rules/Lostqueen/en.pug @@ -0,0 +1,4 @@ +p.boxed + | The goal is to lose the queen. + +p TODO diff --git a/client/src/translations/rules/Lostqueen/es.pug b/client/src/translations/rules/Lostqueen/es.pug new file mode 100644 index 00000000..254e04c7 --- /dev/null +++ b/client/src/translations/rules/Lostqueen/es.pug @@ -0,0 +1,4 @@ +p.boxed + | El objetivo es perder a la dama. + +p TODO diff --git a/client/src/translations/rules/Lostqueen/fr.pug b/client/src/translations/rules/Lostqueen/fr.pug new file mode 100644 index 00000000..46aefd1a --- /dev/null +++ b/client/src/translations/rules/Lostqueen/fr.pug @@ -0,0 +1,4 @@ +p.boxed + | L'objectif est de perdre la dame. + +p TODO diff --git a/client/src/translations/rules/Parachute/fr.pug b/client/src/translations/rules/Parachute/fr.pug index c0a2a9f5..a34040ee 100644 --- a/client/src/translations/rules/Parachute/fr.pug +++ b/client/src/translations/rules/Parachute/fr.pug @@ -32,6 +32,6 @@ p a(href="https://www.chessvariants.com/diffsetup.dir/unachess.html") | variante Unachess II |  sur chessvariants.com. Unachess I donne un trop grand avantage - aux blancs, dans les quelques parties que j'ai pu jouer. + | aux blancs, dans les quelques parties que j'ai pu jouer. p Inventeurs : Jeff Miller et Edward Jackman (1995) diff --git a/client/src/variants/Lostqueen.js b/client/src/variants/Lostqueen.js new file mode 100644 index 00000000..3b640082 --- /dev/null +++ b/client/src/variants/Lostqueen.js @@ -0,0 +1,36 @@ +import { ChessRules } from "@/base_rules"; + +export class LostqueenRules extends ChessRules { + + // The king can move like a knight: + getPotentialKingMoves(sq) { + return ( + super.getPotentialKingMoves(sq).concat( + super.getSlideNJumpMoves(sq, ChessRules.steps[V.KNIGHT], "oneStep")) + ); + } + + // Goal is to lose the queen (or be checkmated): + getCurrentScore() { + // If my queen disappeared, I win + const color = this.turn; + let haveQueen = false; + outerLoop: for (let i=0; i