Add Vchess variant (draft)
authorBenjamin Auder <benjamin.auder@somewhere>
Mon, 20 Jul 2020 16:41:54 +0000 (18:41 +0200)
committerBenjamin Auder <benjamin.auder@somewhere>
Mon, 20 Jul 2020 16:41:54 +0000 (18:41 +0200)
client/src/translations/en.js
client/src/translations/es.js
client/src/translations/fr.js
client/src/translations/rules/Vchess/en.pug [new file with mode: 0644]
client/src/translations/rules/Vchess/es.pug [new file with mode: 0644]
client/src/translations/rules/Vchess/fr.pug [new file with mode: 0644]
client/src/variants/Vchess.js
server/db/populate.sql

index e088adf..f3682cc 100644 (file)
@@ -234,6 +234,7 @@ export const translations = {
   "Non-conformism and utopia": "Non-conformism and utopia",
   "Occupy the enemy palace": "Occupy the enemy palace",
   "Paralyzed pieces": "Paralyzed pieces",
   "Non-conformism and utopia": "Non-conformism and utopia",
   "Occupy the enemy palace": "Occupy the enemy palace",
   "Paralyzed pieces": "Paralyzed pieces",
+  "Pawns capture backward": "Pawns capture backward",
   "Pawns move diagonally": "Pawns move diagonally",
   "Pieces upside down": "Pieces upside down",
   "Play at the same time": "Play at the same time",
   "Pawns move diagonally": "Pawns move diagonally",
   "Pieces upside down": "Pieces upside down",
   "Play at the same time": "Play at the same time",
index 605f501..0dafd6e 100644 (file)
@@ -234,7 +234,8 @@ export const translations = {
   "Non-conformism and utopia": "No-conformismo y utopía",
   "Occupy the enemy palace": "Ocupar el palacio enemigo",
   "Paralyzed pieces": "Piezas paralizadas",
   "Non-conformism and utopia": "No-conformismo y utopía",
   "Occupy the enemy palace": "Ocupar el palacio enemigo",
   "Paralyzed pieces": "Piezas paralizadas",
-  "Pawns move diagonally": "Peones se mueven en diagonal",
+  "Pawns capture backward": "Los peones capturan hacia atrás",
+  "Pawns move diagonally": "Los peones se mueven en diagonal",
   "Pieces upside down": "Piezas al revés",
   "Play at the same time": "Jugar al mismo tiempo",
   "Play more and more moves (v1)": "Jugar más y más movimientos (v1)",
   "Pieces upside down": "Piezas al revés",
   "Play at the same time": "Jugar al mismo tiempo",
   "Play more and more moves (v1)": "Jugar más y más movimientos (v1)",
index a35c4ca..3a38c66 100644 (file)
@@ -234,6 +234,7 @@ export const translations = {
   "Non-conformism and utopia": "Non-conformisme et utopie",
   "Occupy the enemy palace": "Occuper le palais ennemi",
   "Paralyzed pieces": "Pièces paralysées",
   "Non-conformism and utopia": "Non-conformisme et utopie",
   "Occupy the enemy palace": "Occuper le palais ennemi",
   "Paralyzed pieces": "Pièces paralysées",
+  "Pawns capture backward": "Les pions capturent en arrière",
   "Pawns move diagonally": "Les pions vont en diagonale",
   "Pieces upside down": "Pièces à l'envers",
   "Play at the same time": "Jouer en même temps",
   "Pawns move diagonally": "Les pions vont en diagonale",
   "Pieces upside down": "Pièces à l'envers",
   "Play at the same time": "Jouer en même temps",
diff --git a/client/src/translations/rules/Vchess/en.pug b/client/src/translations/rules/Vchess/en.pug
new file mode 100644 (file)
index 0000000..2480abd
--- /dev/null
@@ -0,0 +1,21 @@
+p.boxed
+  | Pawns can capture backward.
+
+p.
+  Orthodox chess, with enhanced pawns: they can capture forward as usual,
+  and also bacwkard - always by one diagonal step.
+
+figure.diagram-container
+  .diagram
+    | fen:k7/2B5/3p4/2p1p3/2P1P3/3P1N2/8/K7:
+  figcaption The bishop and the knight are under attack.
+
+h3 Source
+
+p
+  | This seems to be an original idea of José Victor Gonçalves, thus the name
+  | "Victor-Chess", abridged into Vchess.
+  | Some other variants with different pawn movements are listed 
+  a(href="https://www.chessvariants.com/other.dir/modest-pawn.html")
+    | on this page
+  | .
diff --git a/client/src/translations/rules/Vchess/es.pug b/client/src/translations/rules/Vchess/es.pug
new file mode 100644 (file)
index 0000000..93e7d34
--- /dev/null
@@ -0,0 +1,22 @@
+p.boxed
+  | Los peones pueden capturar hacia atrás.
+
+p.
+  Se aplican reglas ortodoxas, con peones aumentados: pueden capturar hacia
+  adelante como de costumbre, pero también hacia atrás -
+  siempre con un paso diagonal.
+
+figure.diagram-container
+  .diagram
+    | fen:k7/2B5/3p4/2p1p3/2P1P3/3P1N2/8/K7:
+  figcaption El alfil y el caballo son atacados.
+
+h3 Fuente
+
+p
+  | Esta parece ser una idea original de José Victor Gonçalves, de ahí el
+  | nombre "Victor-Chess", abreviado como Vchess. Algunas otras variantes con
+  | diferentes movimientos de peones se enumeran 
+  a(href="https://www.chessvariants.com/other.dir/modest-pawn.html")
+    | en esta página
+  | .
diff --git a/client/src/translations/rules/Vchess/fr.pug b/client/src/translations/rules/Vchess/fr.pug
new file mode 100644 (file)
index 0000000..2660509
--- /dev/null
@@ -0,0 +1,22 @@
+p.boxed
+  | Les pions peuvent capturer en arrière.
+
+p.
+  Les règles orthodoxes s'appliquent, avec des pions augmentés : ils peuvent
+  capturer vers l'avant comme d'habitude, mais aussi en arrière -
+  toujours d'un pas diagonal.
+
+figure.diagram-container
+  .diagram
+    | fen:k7/2B5/3p4/2p1p3/2P1P3/3P1N2/8/K7:
+  figcaption Le fou et le cavalier sont attaqués.
+
+h3 Source
+
+p
+  | Cela semble être une idée originale de José Victor Gonçalves, d'où le nom
+  | "Victor-Chess", abrégé en Vchess. Quelques autres variantes avec
+  | différents déplacements de pions sont listées 
+  a(href="https://www.chessvariants.com/other.dir/modest-pawn.html")
+    | sur cette page
+  | .
index 4e84eb0..8b59c86 100644 (file)
@@ -11,7 +11,16 @@ export class VchessRules extends ChessRules {
 
   getNotation(move) {
     let notation = super.getNotation(move);
 
   getNotation(move) {
     let notation = super.getNotation(move);
-    // TODO: if capture backwards, add an indication 'b'
+    // If pawn captures backward, add an indication 'b'
+    if (
+      move.appear[0].p == V.PAWN &&
+      (
+        (move.appear[0].c == 'w' && (move.end.x - move.start.x > 0)) ||
+        (move.appear[0].c == 'b' && (move.end.x - move.start.x < 0))
+      )
+    ) {
+      notation += 'b';
+    }
     return notation;
   }
 };
     return notation;
   }
 };
index 1543847..8de63af 100644 (file)
@@ -111,6 +111,7 @@ insert or ignore into Variants (name, description) values
   ('Threechecks', 'Give three checks'),
   ('Twokings', 'Two kings'),
   ('Upsidedown', 'Board upside down'),
   ('Threechecks', 'Give three checks'),
   ('Twokings', 'Two kings'),
   ('Upsidedown', 'Board upside down'),
+  ('Vchess', 'Pawns capture backward'),
   ('Wildebeest', 'Balanced sliders & leapers'),
   ('Wormhole', 'Squares disappear'),
   ('Zen', 'Reverse captures');
   ('Wildebeest', 'Balanced sliders & leapers'),
   ('Wormhole', 'Squares disappear'),
   ('Zen', 'Reverse captures');