From: Benjamin Auder Date: Thu, 4 Jan 2024 09:23:47 +0000 (+0100) Subject: Fix Discoduel X-Git-Url: https://git.auder.net/variants/Chakart/assets/img/cross.svg?a=commitdiff_plain;h=4fcd7ab062f5250757804d633df01bd0d06da137;p=xogo.git Fix Discoduel --- diff --git a/variants/Discoduel/class.js b/variants/Discoduel/class.js index c081b31..ec96a43 100644 --- a/variants/Discoduel/class.js +++ b/variants/Discoduel/class.js @@ -38,7 +38,9 @@ export default class DiscoduelRules extends ChessRules { // No real winning condition (promotions count...) if ( ArrayFun.range(1, this.size.x).every(row_idx => { - this.board[row_idx].every(square => square.charAt(0) != 'w') + return this.board[row_idx].every(square => { + return (!square || square.charAt(0) != 'w'); + }) }) || !this.atLeastOneMove(this.turn)