2048.html
changeset 101 7f944bece417
parent 100 40a3a4247e8b
child 102 6c057ac86c97
equal deleted inserted replaced
100:40a3a4247e8b 101:7f944bece417
   766     // Reports and statistic.
   766     // Reports and statistic.
   767 
   767 
   768     var reportsDom = document.getElementById('reports');
   768     var reportsDom = document.getElementById('reports');
   769 
   769 
   770     ui.report = {};
   770     ui.report = {};
       
   771     ui.report.statNo = 1;
   771 
   772 
   772     ui.report.stat = function() {
   773     ui.report.stat = function() {
   773       var stats = [];
   774       var stats = [];
   774       var cnt = parseInt(document.getElementById('stat-count-limit').value);
   775       var cnt = parseInt(document.getElementById('stat-count-limit').value);
   775       if (isNaN(cnt) || !isFinite(cnt) || cnt < 1)
   776       if (isNaN(cnt) || !isFinite(cnt) || cnt < 1)
   847           row.meanSpeed = row.meanSpeed / n;
   848           row.meanSpeed = row.meanSpeed / n;
   848       }
   849       }
   849       var reportDom = document.createElement('div');
   850       var reportDom = document.createElement('div');
   850       reportDom.classList.add('report');
   851       reportDom.classList.add('report');
   851       var h5Dom = document.createElement('h5');
   852       var h5Dom = document.createElement('h5');
   852       h5Dom.appendChild(document.createTextNode(ui.ai.currentName));
   853       h5Dom.appendChild(document.createTextNode(ui.ai.currentName + " #" + ui.report.statNo++));
   853       reportDom.appendChild(h5Dom);
   854       reportDom.appendChild(h5Dom);
   854       var maxVals = Object.keys(histo).sort(function(a,b){return a - b});
   855       var maxVals = Object.keys(histo).sort(function(a,b){return a - b});
   855       var tbl = [];
   856       var tbl = [];
   856       for (var i = maxVals.length-1; i >= 0; i--) {
   857       for (var i = maxVals.length-1; i >= 0; i--) {
   857         var maxVal = maxVals[i];
   858         var maxVal = maxVals[i];