From 77e1ec78ec91089a80bf806667da76826eefd94d Mon Sep 17 00:00:00 2001 From: Benjamin Auder <benjamin.auder@somewhere> Date: Sat, 8 Dec 2018 03:28:01 +0100 Subject: [PATCH] Fix a detail in Loser's flags --- public/javascripts/base_rules.js | 2 +- public/javascripts/variants/Loser.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/public/javascripts/base_rules.js b/public/javascripts/base_rules.js index ee5ddd02..172f68b4 100644 --- a/public/javascripts/base_rules.js +++ b/public/javascripts/base_rules.js @@ -1076,7 +1076,7 @@ class ChessRules for (let i of ['w','b']) { for (let j=0; j<2; j++) - fen += this.castleFlags[i][j] ? '1' : '0'; + fen += (this.castleFlags[i][j] ? '1' : '0'); } return fen; } diff --git a/public/javascripts/variants/Loser.js b/public/javascripts/variants/Loser.js index b4d8b4f0..936c2590 100644 --- a/public/javascripts/variants/Loser.js +++ b/public/javascripts/variants/Loser.js @@ -9,7 +9,7 @@ class LoserRules extends ChessRules setFlags(fen) { // No castling, hence no flags; but flags defined for compatibility - this.castleFlags = "0000"; + this.castleFlags = { "w":[false,false], "b":[false,false] }; } getPotentialPawnMoves([x,y]) @@ -110,6 +110,11 @@ class LoserRules extends ChessRules unupdateVariables(move) { } parseFlags(flags) { } + getFlagsFen() + { + return ""; + } + checkGameEnd() { // No valid move: you win! -- 2.44.0