0) // $stats[ $bots[ $row['black_id'] ][ 'name' ] ][ 'wins' ]++; // else if ($row['score'] < 0) // $stats[ $bots[ $row['white_id'] ][ 'name' ] ][ 'wins' ]++; } $statsql = "SELECT black_id, white_id, round(avg(score),1) as 'avg', sum(score) as 'sum', count(*) as 'games' FROM matchs group by black_id, white_id;"; $res = mysql_query($statsql); while ($row = mysql_fetch_array($res)) { $stats[] = $row; $avg[$row['black_id']][$row['white_id']]['total'] += $row['sum']; $avg[$row['black_id']][$row['white_id']]['games'] += $row['games']; $avg[$row['black_id']][$row['white_id']]['avg'] = round($avg[$row['black_id']][$row['white_id']]['total']/$avg[$row['black_id']][$row['white_id']]['games'],2); if ($row['black_id'] != $row['white_id']) { $avg[$row['white_id']][$row['black_id']]['total'] += -$row['sum']; $avg[$row['white_id']][$row['black_id']]['games'] += $row['games']; $avg[$row['white_id']][$row['black_id']]['avg'] = round($avg[$row['white_id']][$row['black_id']]['total']/$avg[$row['white_id']][$row['black_id']]['games'],2); } } function format_time($time_str) { if ($time_str == "0" or $time_str == null) return "?"; else return round($time_str, 2)."s"; } ?> ai.mindstab.net: Go competition

Return to Wiki

All Matchs
"; print "

$botname $botversion

"; print "Wiki entry for $botname

"; }/* $bot = $stats[$botname]; print ""; print ""; print ""; print "
WinsPercent
".(isset($bot['wins']) ? $bot['wins'] : '0')."/".$bot['matchs'] . "".round($bot['wins']/$bot['matchs']*100)."%
"; } else { print "

Bot Stats

"; print ""; foreach ($stats as $name => $bot) { print ""; print ""; $botname=""; } print "
BotWinsPercent
".$name."".(isset($bot['wins']) ? $bot['wins'] : '0')."/".$bot['matchs'] . "".round($bot['wins']/$bot['matchs']*100)."%
"; }*/ //print "
";
//print_r($avg);
//print "

"; print "

Agerage Scores

"; //These stats wont make sense if handicapping is added print ""; foreach ($bots as $bot) { if ($bot['version'] == $botversion || (!isset($botversion) && $bot['name'] == $botname)) { print ""; } foreach ($bots as $black) { print ""; if ($black['version'] == $botversion || (!isset($botversion) && $black['name'] == $botname)) { print ""; foreach ($bots as $white) { if ($white['version'] == $botversion || $black['version'] == $botversion || (!isset($botversion) && ($white['name'] == $botname || $black['name'] == $botname))) { print "\n"; } print "\n"; } print ""; print "
Black \ White"; } else if (!isset($botname)) { print ""; } else { print ""; } print "".$bot['name'].""; print " - ".$bot['version']."
"; } else if (!isset($botname)) { print ""; } else { print ""; } print "".$black['name'].""; print " - ".$black['version']."= 0) { $score = "B+$score"; if ($black['name'] == $botname) $score = "".$score.""; } else { $score="W+".abs($score); if ($white['name'] == $botname) $score = "".$score.""; } if (substr($score, 0, 1) == "W") print " white\">".$score; else print " black\">".$score; } else { print " empty\">"; } print "
"; /* print ""; foreach ($stats as $stat) { print ""; print ""; print ""; print ""; $score = $stat['avg']; if ($score >= 0) { $score = "B+$score"; print ""; } else { $score="W+".abs($score); print ""; } print ""; } print "
BlackWhiteGames PlayedAverage Score
".$bots[$stat['black_id']]['name'] . ""; print " - " .$bots[$stat['black_id']]['version'] ."".$bots[$stat['white_id']]['name'] . ""; print " - " .$bots[$stat['white_id']]['version'] ."".$stat['games']."".$score."".$score."
"; */ ?>

Matchs

"; print ""; print ""; $score = $match['score']; if ($score >= 0) { $score = "B+$score"; if ($bots[$match['black_id']]['name'] == $botname) $score = "$score"; } else { $score="W+".abs($score); if ($bots[$match['white_id']]['name'] == $botname) $score = "$score"; } print ""; print ""; print ""; print ""; print ""; print ""; print ""; } print "
BlackWhiteScoreDateBlack TimeWhite TimeHandicapSGF file
".$bots[$match['black_id']]['name'] . ""; print " - " .$bots[$match['black_id']]['version'] ."".$bots[$match['white_id']]['name'] . ""; print " - " .$bots[$match['white_id']]['version'] ."".$score."" . $match['date']."". format_time($match['black_time'], 2)."". format_time($match['white_time'], 2)."".$match['handicap']."\"SGF
"; if (isset($_GET['name'])) { $args = "name=".$_GET['name']."&"; } else if (isset($_GET['version'])) { $args = "version=".$_Get['version']."&"; } if (isset($_GET['page'])) { print "
Prev"; print " - Next"; } else { print "Next"; } ?>