X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FJanggi.js;h=27342422dfdcdbe84218e8f3f49057d2304a8284;hb=173f11dc3119c842a58daa9d1e0afc67eeb0e4e8;hp=895e23ff06ce136ffbd2fcf3b8767a8873ae401e;hpb=ac4e2cabce7a0faeceaa646d31721161bd4a8cf4;p=vchess.git diff --git a/client/src/variants/Janggi.js b/client/src/variants/Janggi.js index 895e23ff..27342422 100644 --- a/client/src/variants/Janggi.js +++ b/client/src/variants/Janggi.js @@ -35,10 +35,6 @@ export class JanggiRules extends ChessRules { return false; } - static get LoseOnRepetition() { - return true; - } - static get ELEPHANT() { return "e"; } @@ -56,7 +52,7 @@ export class JanggiRules extends ChessRules { } getPpath(b) { - return "Jiangqi/" + b; + return "Janggi/" + b; } static get size() { @@ -110,9 +106,10 @@ export class JanggiRules extends ChessRules { // TODO: next "if" is mutually exclusive with the block above if (this.movesCount <= 1) { const firstRank = (this.movesCount == 0 ? 9 : 0); - const [initFile, destFile] = (this.subTurn == 1 ? [1, 2] : [7, 6]); + const initDestFile = new Map([[1, 2], [7, 6]]); // Only option is knight / elephant swap: - if (x == firstRank && y == initFile) { + if (x == firstRank && !!initDestFile.get(y)) { + const destFile = initDestFile.get(y); moves.push( new Move({ appear: [