# HG changeset patch # User Oleksandr Gavenko <gavenkoa@gmail.com> # Date 1410975727 -10800 # Node ID 01076b56feaea8b3c27eb41354da73ad4decbe1b # Parent cbdfc1072009e42db1b6edb616dcd787b5c07643 Fix histogram calculation. diff -r cbdfc1072009 -r 01076b56feae 2048.html --- a/2048.html Wed Sep 17 20:36:40 2014 +0300 +++ b/2048.html Wed Sep 17 20:42:07 2014 +0300 @@ -228,7 +228,7 @@ <div id="report-area" class="area"> <h1>Reports</h1> <div class="settings"> - <div class="setting"><input type="text" id="stat-count-limit" value="10"> times</div> + <div class="setting"><input type="text" id="stat-count-limit" value="100"> times</div> <div class="setting">limit to <input type="text" id="stat-time-limit" value="10"> sec</div> <button id="statistic">Start</button> <div class="clearfix"></div> @@ -682,13 +682,13 @@ var speed = (stat.turn * 1000.0) / stat.ts; row.minSpeed = Math.min(row.minSpeed, speed); row.meanSpeed += speed; - row.minSpeed = Math.max(row.minSpeed, speed); + row.maxSpeed = Math.max(row.maxSpeed, speed); row.minTurn = Math.min(row.minTurn, stat.turn); row.meanTurn += stat.turn; - row.maxTurn = Math.max(row.minTurn, stat.turn); + row.maxTurn = Math.max(row.maxTurn, stat.turn); row.minScore = Math.min(row.minScore, stat.score); row.meanScore += stat.score; - row.maxScore = Math.max(row.minScore, stat.score); + row.maxScore = Math.max(row.maxScore, stat.score); } for (var i in histo) { var row = histo[i];