mirror of https://github.com/dirtbags/tanks.git
Just select one winner
This commit is contained in:
parent
af21d38986
commit
b8229bcb8a
|
@ -12,12 +12,18 @@ BEGIN {
|
||||||
p = $4;
|
p = $4;
|
||||||
}
|
}
|
||||||
score[p] += 1;
|
score[p] += 1;
|
||||||
if (score[p] > topscore) {
|
if (score[p] == topscore) {
|
||||||
|
winners += 1;
|
||||||
|
} else if (score[p] > topscore) {
|
||||||
|
winners = 1;
|
||||||
topscore = score[p];
|
topscore = score[p];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
END {
|
END {
|
||||||
|
if (winners > 1) {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
for (id in tanks) {
|
for (id in tanks) {
|
||||||
if (score[id] == topscore) {
|
if (score[id] == topscore) {
|
||||||
print tanks[id];
|
print tanks[id];
|
Loading…
Reference in New Issue