]> git.sesse.net Git - remoteglot-book/blobdiff - www/js/book.js
Show number of computer games in the UI.
[remoteglot-book] / www / js / book.js
index 8300be61da3391a1d4c517ab07f2d41c7a7524e1..cc948fdc3b2152c50014b7eb8dcaee63e818d1b3 100644 (file)
@@ -92,6 +92,8 @@ var headings = [
        [ "Move", TYPE_MOVE ],
        [ "Games", TYPE_INTEGER ],
        [ "%", TYPE_RATIO ],
+       [ "CGames", TYPE_INTEGER ],
+       [ "Comp%", TYPE_RATIO ],
        [ "Win%", TYPE_RATIO ],
        [ "WWin", TYPE_INTEGER ],
        [ "%WW", TYPE_RATIO ],
@@ -167,12 +169,15 @@ var show_lines = function(data, game) {
                var white = parseInt(move['white']);
                var draw = parseInt(move['draw']);
                var black = parseInt(move['black']);
+               var computer = parseInt(move['computer']);
 
                line.push(move['move']);  // Move.
                transpose_only.push(move['transpose_only']);
                var num = white + draw + black;
                line.push(num);  // N.
                line.push(num / total_num);  // %.
+               line.push(computer);  // CGames.
+               line.push(computer / num);  // Comp%.
 
                // Win%.
                var white_win_ratio = (white + 0.5 * draw) / num;