X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FAtomic.js;h=35def3faa0fe53ce4bf180d123abc8dc18da5064;hb=241bf8f2a9a2c48d793aeb0b1d20207f6371de70;hp=996f2d1a203f64591a4676d595f3037bcf3e41a2;hpb=6808d7a16ec1e761c6a2dffec2281c96953e4d89;p=vchess.git diff --git a/client/src/variants/Atomic.js b/client/src/variants/Atomic.js index 996f2d1a..35def3fa 100644 --- a/client/src/variants/Atomic.js +++ b/client/src/variants/Atomic.js @@ -6,9 +6,9 @@ export const VariantRules = class AtomicRules extends ChessRules { // Handle explosions moves.forEach(m => { + // NOTE: if vanish.length==2 and appear.length==2, this is castle if (m.vanish.length > 1 && m.appear.length <= 1) { - //avoid castles - // Explosion! OPTION (TODO?): drop moves which explode our king here + // Explosion! (TODO?: drop moves which explode our king here) let steps = [ [-1, -1], [-1, 0], @@ -76,7 +76,7 @@ export const VariantRules = class AtomicRules extends ChessRules { updateVariables(move) { super.updateVariables(move); if (move.appear.length == 0) { - //capture + // Capture const firstRank = { w: 7, b: 0 }; for (let c of ["w", "b"]) { // Did we explode king of color c ? (TODO: remove move earlier) @@ -143,10 +143,9 @@ export const VariantRules = class AtomicRules extends ChessRules { const color = this.turn; const kp = this.kingPos[color]; if (kp[0] < 0) - //king disappeared + // King disappeared return color == "w" ? "0-1" : "1-0"; if (this.atLeastOneMove()) - // game not over return "*"; if (!this.isAttacked(kp, [V.GetOppCol(color)])) return "1/2"; return color == "w" ? "0-1" : "1-0"; //checkmate