From 47f9d8ac16010d034373b1a2959778d391987909 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 25 Jan 2007 23:40:15 +0000 Subject: Score display cleanups in azgame --- data/rbot/plugins/azgame.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/data/rbot/plugins/azgame.rb b/data/rbot/plugins/azgame.rb index 9721d8b8..1046bba3 100644 --- a/data/rbot/plugins/azgame.rb +++ b/data/rbot/plugins/azgame.rb @@ -70,11 +70,12 @@ class AzGame debug "Total score: #{t}" ret = Hash.new @tries.each { |k, a| - ret[k] = [t*a/n, "%d tries" % a] + ret[k] = [t*a/n, "%d %s" % [a, a > 1 ? "tries" : "try"]] } if @winner debug "replacing winner score of %d with %d" % [ret[@winner].first, t] - ret[@winner] = [t, "winner"] + tries = ret[@winner].last + ret[@winner] = [t, "winner, #{tries}"] end return ret.sort_by { |h| h.last.first } end -- cgit v1.2.3