]> git.sesse.net Git - remoteglot-book/blobdiff - www/js/book.js
Show an adjusted human index instead of the raw percentage of computer games.
[remoteglot-book] / www / js / book.js
index cc948fdc3b2152c50014b7eb8dcaee63e818d1b3..c6290f17cd13ff6dcaea29928a59834a8e995fe5 100644 (file)
@@ -93,7 +93,7 @@ var headings = [
        [ "Games", TYPE_INTEGER ],
        [ "%", TYPE_RATIO ],
        [ "CGames", TYPE_INTEGER ],
-       [ "Comp%", TYPE_RATIO ],
+       [ "Hum", TYPE_RATIO ],
        [ "Win%", TYPE_RATIO ],
        [ "WWin", TYPE_INTEGER ],
        [ "%WW", TYPE_RATIO ],
@@ -177,7 +177,10 @@ var show_lines = function(data, game) {
                line.push(num);  // N.
                line.push(num / total_num);  // %.
                line.push(computer);  // CGames.
-               line.push(computer / num);  // Comp%.
+
+               // Adjust so that the human index is 50% overall.
+               var exp = Math.log(0.5) / Math.log(data['computer_games'] / data['total_games']);
+               line.push(1.0 - Math.pow(computer / num, exp));  // Hum.
 
                // Win%.
                var white_win_ratio = (white + 0.5 * draw) / num;