magarena/scripts/score_ai.awk

30 lines
621 B
Awk
Raw Normal View History

2011-06-29 00:50:27 -07:00
#!/usr/bin/awk -f
#release/decks/LSK_RW.dec RND 6 release/decks/LSK_RW.dec VEGAS 6 10 0 10
#release/decks/LSK_RW.dec RND 6 release/decks/LSK_RW.dec VEGAS 6 10 3 7
2011-06-10 05:32:53 -07:00
BEGIN {
FS = "\t"
OFS = "\t"
}
NF == 9 {
if ($8 + $9 > win[$2] + lose[$2]) {
s1[$2] -= win[$2]
s2[$2] -= lose[$2]
}
win[$2] = $8
lose[$2] = $9
s1[$2] += win[$2]
s2[$2] += lose[$2]
2011-06-10 05:32:53 -07:00
}
END {
for (ai in s1) {
total = s1[ai] + s2[ai]
print "Total = " total
print ai, s1[ai], s2[ai], s1[ai]*100/total
}
2011-06-10 05:32:53 -07:00
}