From: Benjamin Auder Date: Wed, 4 Nov 2026 15:03:06 +0000 (+0100) Subject: Really TODO this TwoSquareMove ?! X-Git-Url: https://git.auder.net/?a=commitdiff_plain;h=1c9f247e6fcc3442585b5a0ec8e9c64702da7cf6;p=xogo.git Really TODO this TwoSquareMove ?! --- diff --git a/variants/Fanorona/class.js b/variants/Fanorona/class.js index d88b5b6..f1f4ba8 100644 --- a/variants/Fanorona/class.js +++ b/variants/Fanorona/class.js @@ -203,10 +203,21 @@ export default class FanoronaRules extends AbstractOnGridRules { const step = [x2 - x1, y2 - y1]; if ( this.canCapture && - ( // TODO........... - this.onBoard(x1 - step[0], y1 - step[1]) && + ( + !this.onBoard(x1 - step[0], y1 - step[1]) || + this.board[x1 - step[0]][y1 - step[1]] == "" + ) + && + ( + !this.onBoard(x1 + step[0], y1 + step[1]) || + this.board[x1 + step[0]][y1 + step[1]] == "" + ) + ) { + return []; + } + // Ok, the move seems valid let moves = []; - +////////// TODO ????????? } atLeastOneCapture() {