Start at scoreboard generation

This commit is contained in:
Neale Pickett 2010-09-06 21:52:09 -06:00
parent c74c457136
commit aea9f3cbeb
1 changed files with 38 additions and 0 deletions

38
src/scoreboard Executable file
View File

@ -0,0 +1,38 @@
#! /usr/bin/awk -f
function output() {
for (c in points_by_cat) {
for (t in teams) {
printf("%d %s %f\n",
(lasttime - start) / 600,
t,
points_by_cat_team[c, t] / points_by_cat[c]);
}
}
}
{
time = $1
team = $2
cat = $3
points = int($4)
if (! start) {
start = time
}
# Every 10 minutes
if (time > (outtime + 600)) {
outtime = time
output()
}
lasttime = time
teams[team] = team
points_by_cat[cat] += points
points_by_cat_team[cat, team] += points
}
END {
output()
}