X-Git-Url: https://git.auder.net/pieces/cr.svg?a=blobdiff_plain;f=public%2Fjavascripts%2Fbase_rules.js;h=6bc3591cfc601c3604a4f7c7f7f0619db8c5b553;hb=8a60cacd26d8c47f52ecac26091d6a6f65e6bbc5;hp=f1188ab5b1c544ca14b6d17c64d9e1a3ded05f8a;hpb=a6abf094c35a26019e47fea21302c4be32ff030b;p=vchess.git diff --git a/public/javascripts/base_rules.js b/public/javascripts/base_rules.js index f1188ab5..6bc3591c 100644 --- a/public/javascripts/base_rules.js +++ b/public/javascripts/base_rules.js @@ -276,7 +276,8 @@ class ChessRules { let i = x + step[0]; let j = y + step[1]; - while (i>=0 && i=0 && j=0 && i=0 && j0 && this.canTake([x,y], [x+shift,y-1]) && this.board[x+shift][y-1] != V.EMPTY) + if (y>0 && this.canTake([x,y], [x+shift,y-1]) + && this.board[x+shift][y-1] != V.EMPTY) + { moves.push(this.getBasicMove([x,y], [x+shift,y-1])); - if (y0 && this.canTake([x,y], [x+shift,y-1]) && this.board[x+shift][y-1] != V.EMPTY) + if (y>0 && this.canTake([x,y], [x+shift,y-1]) + && this.board[x+shift][y-1] != V.EMPTY) + { moves.push(this.getBasicMove([x,y], [x+shift,y-1], {c:color,p:p})); - if (y'; pgn += '[Result "' + score + '"]

'; + // Standard PGN for (let i=0; i
"; + // "Complete moves" PGN (helping in ambiguous cases) + for (let i=0; i