From 13424b02b13c2edd1f4dd14412d584b862cd7bc3 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Wed, 6 Jun 2012 22:11:54 -0600 Subject: [PATCH] working p2 scoreboard --- packages/p2/bin/scoreboard | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/packages/p2/bin/scoreboard b/packages/p2/bin/scoreboard index 64b312b..4f5199e 100755 --- a/packages/p2/bin/scoreboard +++ b/packages/p2/bin/scoreboard @@ -36,20 +36,22 @@ function head() { print "" print "" print "" print "
" @@ -114,6 +116,12 @@ END { # Sort scores qsort(scores, 0, nteams-1) + print "

" + for (ncat = 0; ncat < ncats; ncat += 1) { + printf("%s\n", ncat, categories[ncat]); + } + print "

" + for (i = nteams-1; i >= 0; i -= 1) { score = scores[i]; if (score == scores[i-1]) continue; # Skip duplicates @@ -124,6 +132,7 @@ END { } name = escape(team_names[hash]) + print "

" printf("%s\n", name) for (ncat = 0; ncat < ncats; ncat += 1) { @@ -131,12 +140,13 @@ END { points = cat_points[hash, cat]; if (cat_points[hash, cat] > 0) { - width = cat_score[hash, cat] / max_score * 80 + width = cat_score[hash, cat] / max_score * 90 printf("", cat, points, name) - printf(" %d\n", + printf("%d", ncat, width, cat_points[hash, cat]) } } + print "

" } }