tanks/winners.awk

26 lines
345 B
Awk
Raw Normal View History

#! /usr/bin/awk -f
BEGIN {
FS = "\t";
}
{
2010-10-26 14:57:17 -06:00
tanks[$1] = $2;
if ($4 == "(nil)") {
p = $1;
} else {
p = $4;
}
score[p] += 1;
if (score[p] > topscore) {
topscore = score[p];
}
}
END {
for (id in tanks) {
if (score[id] == topscore) {
2010-10-26 14:57:17 -06:00
print tanks[id];
}
}
}