mirror of https://github.com/dirtbags/moth.git
Further work on scoreboard
This commit is contained in:
parent
2fe4123f87
commit
a2b8a2873b
|
@ -1,14 +1,25 @@
|
||||||
#! /usr/bin/awk -f
|
#! /usr/bin/awk -f
|
||||||
|
|
||||||
|
BEGIN {
|
||||||
|
# Every 2.5 minutes
|
||||||
|
interval = 150
|
||||||
|
tslen = 0
|
||||||
|
}
|
||||||
|
|
||||||
function output() {
|
function output() {
|
||||||
for (c in points_by_cat) {
|
|
||||||
for (t in teams) {
|
for (t in teams) {
|
||||||
printf("%d %s %f\n",
|
score = 0;
|
||||||
(lasttime - start) / 600,
|
for (c in points_by_cat) {
|
||||||
t,
|
score += points_by_cat_team[c, t] / points_by_cat[c];
|
||||||
points_by_cat_team[c, t] / points_by_cat[c]);
|
}
|
||||||
|
if (score > maxscore) {
|
||||||
|
maxscore = score
|
||||||
|
}
|
||||||
|
if (score > 0.009) {
|
||||||
|
scores_by_team_time[t, lasttime] = score
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
timestamps[tslen++] = lasttime
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -21,8 +32,7 @@ function output() {
|
||||||
start = time
|
start = time
|
||||||
}
|
}
|
||||||
|
|
||||||
# Every 10 minutes
|
if (time > (outtime + interval)) {
|
||||||
if (time > (outtime + 600)) {
|
|
||||||
outtime = time
|
outtime = time
|
||||||
output()
|
output()
|
||||||
}
|
}
|
||||||
|
@ -35,4 +45,12 @@ function output() {
|
||||||
|
|
||||||
END {
|
END {
|
||||||
output()
|
output()
|
||||||
|
|
||||||
|
for (i = 1; i < tslen; i += 1) {
|
||||||
|
time = timestamps[i]
|
||||||
|
print time
|
||||||
|
for (team in teams) {
|
||||||
|
printf(" %s: %f\n", team, scores_by_team_time[team, time])
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue