X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=public%2Fjavascripts%2Fvariants%2FGrand.js;h=9e1504d9f9a7dcbee49ca4bede9e5885e3c8d673;hp=844d62c740c7c203729fb7dadd251792fa5506b8;hb=9234226104764b91df9d677fb360ad538b98510c;hpb=794b8a9863358c4572726c0d89704271efcf2527 diff --git a/public/javascripts/variants/Grand.js b/public/javascripts/variants/Grand.js index 844d62c7..9e1504d9 100644 --- a/public/javascripts/variants/Grand.js +++ b/public/javascripts/variants/Grand.js @@ -1,4 +1,5 @@ -//https://www.chessvariants.com/large.dir/freeling.html +// NOTE: initial setup differs from the original; see +// https://www.chessvariants.com/large.dir/freeling.html class GrandRules extends ChessRules { static getPpath(b) @@ -84,10 +85,16 @@ class GrandRules extends ChessRules } } // Captures - if (y>0 && 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