X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FRoyalrace.js;h=e3ed224bbbef4675fafb301d291840b89ad2135b;hp=1ae531d5083fdb312861c265be0607c88a84f8ce;hb=f446ee645526d617c8369add83de66888d2db6ce;hpb=0ba6420d3515e278b34c29e5afa1e58f6e08e9eb diff --git a/client/src/variants/Royalrace.js b/client/src/variants/Royalrace.js index 1ae531d5..e3ed224b 100644 --- a/client/src/variants/Royalrace.js +++ b/client/src/variants/Royalrace.js @@ -84,9 +84,11 @@ export const VariantRules = class RoyalraceRules extends ChessRules { "11/11/11/11/11/11/11/11/11/" + whiteFen.substr(5).split("").reverse().join("") + "1" + - blackFen.substr(5).split("").reverse().join("") + + blackFen.substr(5).split("").join("") + "/" + - whiteFen.substr(0,5) + "1" + blackFen.substr(0,5) + + whiteFen.substr(0,5) + + "1" + + blackFen.substr(0,5).split("").reverse().join("") + " w 0" ); } @@ -99,15 +101,16 @@ export const VariantRules = class RoyalraceRules extends ChessRules { return m.vanish.length == 1; }); - // Captures - const shiftX = -1; - for (let shiftY of [-1, 1]) { - if ( - V.OnBoard(x + shiftX, y + shiftY) && - this.board[x + shiftX][y + shiftY] != V.EMPTY && - this.canTake([x, y], [x + shiftX, y + shiftY]) - ) { - moves.push(this.getBasicMove([x, y], [x + shiftX, y + shiftY])); + // Captures (in both directions) + for (let shiftX of [-1, 1]) { + for (let shiftY of [-1, 1]) { + if ( + V.OnBoard(x + shiftX, y + shiftY) && + this.board[x + shiftX][y + shiftY] != V.EMPTY && + this.canTake([x, y], [x + shiftX, y + shiftY]) + ) { + moves.push(this.getBasicMove([x, y], [x + shiftX, y + shiftY])); + } } }