diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-01-25 23:40:15 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-01-25 23:40:15 +0000 |
commit | 47f9d8ac16010d034373b1a2959778d391987909 (patch) | |
tree | b8a532d57fb7749d334cc14f64c161d89487f28f /data | |
parent | cdb3d2609c8f0ff5c8fca3b5e6d73de8db40a40f (diff) |
Score display cleanups in azgame
Diffstat (limited to 'data')
-rw-r--r-- | data/rbot/plugins/azgame.rb | 5 |
1 files 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
|