X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fbase_rules.js;h=e886273698e9a423e2399868b1aa667415bbcddf;hb=6752407b88b6d7678b9b19df4ffe1224d17625d7;hp=f1188ab5b1c544ca14b6d17c64d9e1a3ded05f8a;hpb=a6abf094c35a26019e47fea21302c4be32ff030b;p=vchess.git diff --git a/public/javascripts/base_rules.js b/public/javascripts/base_rules.js index f1188ab5..e8862736 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