]> git.sesse.net Git - remoteglot/commitdiff
Small tweaks to TB-win messaging.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 2 Jan 2021 13:26:58 +0000 (14:26 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 2 Jan 2021 13:26:58 +0000 (14:26 +0100)
www/js/remoteglot.js

index e111bc6d8a817cfb4f5aab0eb2a4a66878f971b1..db816564829ca7a293be77c4ecc623cdccb89a2f 100644 (file)
@@ -7,7 +7,7 @@
  * @type {Number}
  * @const
  * @private */
-var SCRIPT_VERSION = 2020122900;
+var SCRIPT_VERSION = 2021010200;
 
 /**
  * The current backend URL.
@@ -2150,9 +2150,17 @@ var format_long_score = function(score) {
        }
        if (score[0] === 'tb') {
                if (score[1] > 0) {
-                       return "White wins in " + Math.ceil(score[1] / 2);
+                       if (score[1] == 0) {
+                               return "Won for white (tablebase)";
+                       } else {
+                               return "White wins in " + Math.ceil(score[1] / 2);
+                       }
                } else {
-                       return "Black wins in " + Math.ceil(-score[1] / 2);
+                       if (score[1] == -1) {
+                               return "Won for black (tablebase)";
+                       } else {
+                               return "Black wins in " + Math.ceil(-score[1] / 2);
+                       }
                }
        } else if (score[0] === 'm') {
                if (score[1] > 0) {