return V.CanFlip;
}
+ // NOTE: these will disappear once each variant has its dedicated SVG board.
// For (generally old) variants without checkered board
static get Monochrome() {
return false;
}
-
// Some games are drawn unusually (bottom right corner is black)
static get DarkBottomRight() {
return false;
}
-
// Some variants require lines drawing
static get Lines() {
if (V.Monochrome) {
"Asymmetric random": "Asymmetric random",
"Authentication successful!": "Authentication successful!",
"Back to list": "Back to list",
- "Black": "Black",
+ Balanced: "Balanced",
+ Black: "Black",
"Black to move": "Black to move",
"Black surrender": "Black surrender",
"Black win": "Black win",
"Enter the disco": "Enter the disco",
"Exchange pieces' positions": "Exchange pieces' positions",
"Exotic captures": "Exotic captures",
- "Explosive captures (v1)": "Explosive captures (v1)",
- "Explosive captures (v2)": "Explosive captures (v2)",
+ "Explosive captures": "Explosive captures",
"Extra bishops and knights": "Extra bishops and knights",
"Faster development": "Faster development",
"First capture wins": "First capture wins",
"Asymmetric random": "Aleatorio asimétrico",
"Authentication successful!": "¡Autenticación exitosa!",
"Back to list": "Volver a la lista",
+ Balanced: "Equilibrado",
Black: "Negras",
"Black to move": "Juegan las negras",
"Black surrender": "Las negras abandonan",
"Enter the disco": "Entrar en la discoteca",
"Exchange pieces' positions": "Intercambiar posiciones de piezas",
"Exotic captures": "Capturas exóticas",
- "Explosive captures (v1)": "Capturas explosivas (v1)",
- "Explosive captures (v2)": "Capturas explosivas (v2)",
+ "Explosive captures": "Capturas explosivas",
"Extra bishops and knights": "Alfiles y caballos adicionales",
"Faster development": "Desarrollo acelerado",
"First capture wins": "La primera captura gana",
"Asymmetric random": "Aléatoire asymétrique",
"Authentication successful!": "Authentification réussie !",
"Back to list": "Retour à la liste",
- "Black": "Noirs",
+ Balanced: "Équilibré",
+ Black: "Noirs",
"Black to move": "Trait aux noirs",
"Black surrender": "Les noirs abandonnent",
"Black win": "Les noirs gagnent",
"Enter the disco": "Entrez dans la boîte",
"Exchange pieces' positions": "Échangez les positions des pièces",
"Exotic captures": "Captures exotiques",
- "Explosive captures (v1)": "Captures explosives (v1)",
- "Explosive captures (v2)": "Captures explosives (v2)",
+ "Explosive captures": "Captures explosives",
"Extra bishops and knights": "Fous et cavaliers supplémentaires",
"Faster development": "Développement accéléré",
"First capture wins": "La première capture gagne",
p Explosions have priority: a checkmate followed by a king explosion loses.
figure.diagram-container
- .diagram
- | fen:r3kbnr/pp3ppp/3p4/4p3/8/8/PPPPPPPP/R1BQKBNR:
- figcaption.
- After the moves 1.Nc3 d6?? 2.Nd5 e5 (forced to avoid king explosion)
- 3.Nxc7
+ .diagram.diag12
+ | fen:3rkbnr/pb1pp2p/npp5/q4ppQ/P1B1P3/NP5N/1BPP1PPP/R3K2R:
+ .diagram.diag22
+ | fen:3rkbnr/pb1pp2p/npp5/5ppQ/P1B1P3/NP5N/1BP2PPP/R6R:
+ figcaption 1.Qh5+ (left) 1...Qxd2# (right), black wins.
+
+h3 Balancing
+
+p.
+ White has a big advantage in this variant. In order to balance the odds,
+ you can select "Balanced" to let white choose any pawn (any color) to
+ remove before the game starts.
+ The game then continues normally, black playing first.
+
+p
+ | This was suggested (relayed?) and analyzed recently (2020) by a strong
+ | Atomic player (Gannet on Discord). See
+ a(href="https://discord.com/channels/686736099959504907/687076744095858762/762398439043498046")
+ | the messages
+ | on Discord vchess server.
h3 More information
p Las explosiones tienen prioridad: un mate seguida de una explosión pierde.
figure.diagram-container
- .diagram
- | fen:r3kbnr/pp3ppp/3p4/4p3/8/8/PPPPPPPP/R1BQKBNR:
- figcaption.
- Después de las jugadas 1.Nc3 d6?? 2.Nd5 e5 (forzado, para evitar la
- explosión del rey) 3.Nxc7
+ .diagram.diag12
+ | fen:3rkbnr/pb1pp2p/npp5/q4ppQ/P1B1P3/NP5N/1BPP1PPP/R3K2R:
+ .diagram.diag22
+ | fen:3rkbnr/pb1pp2p/npp5/5ppQ/P1B1P3/NP5N/1BP2PPP/R6R:
+ figcaption 1.Qh5+ (izquierda) 1...Qxd2# (derecha), las negras ganan.
+
+h4 Equilibrio
+
+p.
+ Las blancas tienen una gran ventaja en esta variante. Para reequilibrar
+ probabilidades, puede seleccionar "Equilibrado" para que las blancas
+ elige un peón (de cualquier color) para eliminar
+ antes de que comience el juego. Luego, la partida continúa
+ como de costumbre, con las negras jugando primero.
+
+p
+ | Esto ha sido sugerido (¿retransmitido?) y analizado recientemente (2020)
+ | por un fuerte jugador de ajedrez atómico (Gannet en Discord). Ver
+ a(href="https://discord.com/channels/686736099959504907/687076744095858762/762398439043498046")
+ | los mensajes
+ | en el servidor Discord de vchess.
h3 Más información
p Les explosions ont la priorité : un mat suivi d'une explosion perd.
figure.diagram-container
- .diagram
- | fen:r3kbnr/pp3ppp/3p4/4p3/8/8/PPPPPPPP/R1BQKBNR:
- figcaption.
- Après les coups 1.Nc3 d6?? 2.Nd5 e5 (forcé pour éviter l'explosion du roi)
- 3.Nxc7
+ .diagram.diag12
+ | fen:3rkbnr/pb1pp2p/npp5/q4ppQ/P1B1P3/NP5N/1BPP1PPP/R3K2R:
+ .diagram.diag22
+ | fen:3rkbnr/pb1pp2p/npp5/5ppQ/P1B1P3/NP5N/1BP2PPP/R6R:
+ figcaption 1.Qh5+ (gauche) 1...Qxd2# (droite), les noirs gagnent.
+
+h4 Équilibrage
+
+p.
+ Les blancs ont un gros avantage dans cette variante. Afin de rééquilibrer
+ les chances, vous pouvez sélectionner "Équilibré" pour laisser les blancs
+ choisir un pion (de n'importe quelle couleur) à supprimer
+ avant que la partie commence.
+ Le jeu continue ensuite normalement, les noirs jouant en premier.
+
+p
+ | Ceci a été suggéré (relayé ?) et analysé récemment (2020) par un fort
+ | joueur d'échecs atomiques (Gannet sur Discord). Voir
+ a(href="https://discord.com/channels/686736099959504907/687076744095858762/762398439043498046")
+ | les messages
+ | sur le serveur Discord de vchess.
h3 Plus d'information
+++ /dev/null
-p.boxed.
- Atomic1, but white's first move is a pawn removal.
-
-p.
- At the very first move of the game, white must remove a pawn,
- from either side.
- Black then replies, and the game continues normally.
-
-figure.diagram-container
- .diagram
- | fen:rnbqkbnr/pppppppp/8/8/8/8/PPPP1PPP/RNBQKBNR:
- figcaption After 1.e2X, pawn removal at e2.
-
-h3 More information
-
-p
- | This variant aims at balancing the big white's advantage in Atomic1.
- | It was suggested (relayed?) and analyzed recently (2020) by a strong
- | Atomic player (Gannet on Discord). See
- a(href="https://discord.com/channels/686736099959504907/687076744095858762/762398439043498046")
- | the messages
- | on Discord vchess server.
+++ /dev/null
-p.boxed.
- Atomic1, pero el primer movimiento de las blancas es quitar un peón.
-
-p.
- En el primer movimiento del juego, las blancas deben elegir un peón para
- borrar, blanco o negro.
- Entonces las negras responden, luego el juego continúa normalmente.
-
-figure.diagram-container
- .diagram
- | fen:rnbqkbnr/pppppppp/8/8/8/8/PPPP1PPP/RNBQKBNR:
- figcaption Después de 1.e2X, remoción de peones en e2.
-
-h3 Más información
-
-p
- | Esta variante tiene como objetivo reequilibrar la gran ventaja de las
- | blancas en Atomic1. Ha sido sugerido (¿retransmitido?) y analizado
- | recientemente (2020) por un fuerte jugador de ajedrez atómico
- | (Gannet en Discord). Ver
- a(href="https://discord.com/channels/686736099959504907/687076744095858762/762398439043498046")
- | los mensajes
- | en el servidor Discord de vchess.
+++ /dev/null
-p.boxed.
- Atomic1, mais le premier coup des blancs consiste à supprimer un pion.
-
-p.
- Au tout premier coup de la partie, les blancs doivent choisir un pion à
- supprimer, blanc ou noir.
- Les noirs répondent alors, puis la partie continue normalement.
-
-figure.diagram-container
- .diagram
- | fen:rnbqkbnr/pppppppp/8/8/8/8/PPPP1PPP/RNBQKBNR:
- figcaption.
- Après 1.e2X, suppression de pion en e2.
-
-h3 Plus d'information
-
-p
- | Cette variante vise à rééquilibrer le gros avantage blanc en Atomic1.
- | Elle a été suggérée (relayée ?) et analysée récemment (2020) par un fort
- | joueur d'échecs atomiques (Gannet sur Discord). Voir
- a(href="https://discord.com/channels/686736099959504907/687076744095858762/762398439043498046")
- | les messages
- | sur le serveur Discord de vchess.
-import { ChessRules, PiPo } from "@/base_rules";
+import { ChessRules, Move, PiPo } from "@/base_rules";
-export class Atomic1Rules extends ChessRules {
+export class AtomicRules extends ChessRules {
+
+ static get Options() {
+ return {
+ check: [
+ {
+ label: "Balanced",
+ defaut: false,
+ variable: "balanced"
+ }
+ ],
+ select: ChessRules.Options.select
+ };
+ }
+
+ static AbbreviateOptions(opts) {
+ return opts["balanced"] ? 'B' : '';
+ }
+
+ static GenRandInitFen(options) {
+ return ChessRules.GenRandInitFen(options) + (options.balanced ? " B" : "");
+ }
+
+ setOtherVariables(fen) {
+ super.setOtherVariables(fen);
+ this.balanced = !!V.ParseFen(fen).balanced;
+ }
+
+ static ParseFen(fen) {
+ return Object.assign(
+ { balanced: fen.split(" ")[5] },
+ ChessRules.ParseFen(fen)
+ );
+ }
+
+ static IsGoodFen(fen) {
+ if (!ChessRules.IsGoodFen(fen)) return false;
+ const balanced = V.ParseFen(fen).balanced;
+ return (!balanced || balanced == 'B');
+ }
+
+ getFen() {
+ return super.getFen() + (this.balanced ? " B" : "");
+ }
+
+ hoverHighlight([x, y]) {
+ return this.balanced && this.movesCount == 0 && [1, 6].includes(x);
+ }
+
+ canIplay(side, [x, y]) {
+ if (this.balanced && this.movesCount == 0)
+ return (this.turn == side && this.getPiece(x, y) == V.PAWN);
+ return super.canIplay(side, [x, y]);
+ }
+
+ doClick(square) {
+ if (!this.balanced || this.movesCount >= 1) return null;
+ const [x, y] = [square[0], square[1]];
+ if (![1, 6].includes(x)) return null;
+ return new Move({
+ appear: [],
+ vanish: [
+ new PiPo({
+ x: x,
+ y: y,
+ c: this.getColor(x, y),
+ p: V.PAWN
+ })
+ ],
+ start: { x: x, y: y },
+ end: { x: x, y: y }
+ });
+ }
getPotentialMovesFrom([x, y]) {
- let moves = super.getPotentialMovesFrom([x, y]);
+ if (this.balanced && this.movesCount == 0) {
+ if ([1, 6].includes(x)) {
+ const c = this.getColor(x, y);
+ return [
+ new Move({
+ appear: [],
+ vanish: [
+ new PiPo({ x: x, y: y, p: V.PAWN, c: c })
+ ],
+ start: { x: x, y: y },
+ end: { x: x, y: y }
+ })
+ ];
+ }
+ return [];
+ }
+ let moves = super.getPotentialMovesFrom([x, y]);
if (this.getPiece(x, y) == V.PAWN) {
// Promotions by captures can be reduced to only one deterministic
// move (because of the explosion).
);
});
}
-
// Handle explosions
moves.forEach(m => {
// NOTE: if vanish.length==2 and appear.length==2, this is castle
m.appear.pop(); //Nothin appears in this case
}
});
-
return moves;
}
super.postUndo(move);
const c = this.turn;
const oppCol = V.GetOppCol(c);
- // NOTE: condition on movesCount for Atomic2
+ // NOTE: condition on movesCount for balanced setting
if (
this.movesCount >= 1 &&
[this.kingPos[c][0], this.kingPos[oppCol][0]].some(e => e < 0)
return color == "w" ? "0-1" : "1-0"; //checkmate
}
+ getNotation(move) {
+ if (move.appear.length == 0 && move.vanish.length == 1)
+ // First move in game (balanced == true)
+ return V.CoordsToSquare(move.start) + "X";
+ return super.getNotation(move);
+ }
+
};
+++ /dev/null
-import { ChessRules, Move, PiPo } from "@/base_rules";
-import { Atomic1Rules } from "@/variants/Atomic1";
-
-export class Atomic2Rules extends Atomic1Rules {
-
- getPotentialMovesFrom([x, y]) {
- if (this.movesCount == 0) {
- if ([1, 6].includes(x)) {
- const c = this.getColor(x, y);
- return [
- new Move({
- appear: [],
- vanish: [
- new PiPo({ x: x, y: y, p: V.PAWN, c: c })
- ],
- start: { x: x, y: y },
- end: { x: x, y: y }
- })
- ];
- }
- return [];
- }
- return super.getPotentialMovesFrom([x, y]);
- }
-
- hoverHighlight([x, y]) {
- return this.movesCount == 0 && [1, 6].includes(x);
- }
-
- canIplay(side, [x, y]) {
- if (this.movesCount == 0)
- return (this.turn == side && this.getPiece(x, y) == V.PAWN);
- return super.canIplay(side, [x, y]);
- }
-
- doClick(square) {
- if (this.movesCount >= 1) return null;
- const [x, y] = [square[0], square[1]];
- if (![1, 6].includes(x)) return null;
- return new Move({
- appear: [],
- vanish: [
- new PiPo({
- x: x,
- y: y,
- c: this.getColor(x, y),
- p: V.PAWN
- })
- ],
- start: { x: x, y: y },
- end: { x: x, y: y }
- });
- }
-
- getNotation(move) {
- if (move.appear.length == 0 && move.vanish.length == 1)
- // First move in game
- return V.CoordsToSquare(move.start) + "X";
- return super.getNotation(move);
- }
-
-};
static IsGoodFen(fen) {
if (!ChessRules.IsGoodFen(fen)) return false;
const armies = V.ParseFen(fen).armies;
- if (!armies || !armies.match(/^[CNRF]{2,2}$/)) return false;
- return true;
+ return (!!armies && armies.match(/^[CNRF]{2,2}$/));
}
getFen() {
('Antimatter', 'Dangerous collisions', 18, 'Antimatter'),
('Arena', 'Middle battle', 1, 'Arena'),
('Atarigo', 'First capture wins', 28, 'Atari-Go'),
- ('Atomic1', 'Explosive captures (v1)', 18, 'Atomic 1'),
- ('Atomic2', 'Explosive captures (v2)', 18, 'Atomic 2'),
- ('Avalam1', 'Build towers (v1)', 28, 'Avalam 1'),
- ('Avalam2', 'Build towers (v2)', 28, 'Avalam 2'),
+ ('Atomic', 'Explosive captures', 18, 'Atomic Chess'),
+ ('Avalam1', 'Build towers (v1)', 28, 'Avalam1'),
+ ('Avalam2', 'Build towers (v2)', 28, 'Avalam2'),
('Avalanche', 'Pawnfalls', 24, 'Avalanche'),
('Ball', 'Score a goal', 6, 'Ball'),
('Balaklava', 'Meet the Mammoth', 15, 'Balaklava'),