summaryrefslogtreecommitdiff
path: root/data/rbot/plugins/games
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-10-21 23:25:07 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-10-21 23:25:07 +0000
commitf770e0f1a7a340adf5dbc7c44e6593e7debf0522 (patch)
tree8b21394c9f5049141d924b775eb1285ffd12eef7 /data/rbot/plugins/games
parenta664049fc24e14bef458aee8f839b6a8c1909c3b (diff)
azgame: fix score calculation
Diffstat (limited to 'data/rbot/plugins/games')
-rw-r--r--data/rbot/plugins/games/azgame.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/data/rbot/plugins/games/azgame.rb b/data/rbot/plugins/games/azgame.rb
index f0640b59..f5e677e9 100644
--- a/data/rbot/plugins/games/azgame.rb
+++ b/data/rbot/plugins/games/azgame.rb
@@ -53,7 +53,7 @@ class AzGame
return [:in, @range]
end
-# TODO scoring: base score is t = ceil(100*exp(-(n-1)^2/50))+p for n attempts
+# TODO scoring: base score is t = ceil(100*exp(-((n-1)^2)/(50^2)))+p for n attempts
# done by p players; players that didn't win but contributed
# with a attempts will get t*a/n points
@@ -62,7 +62,7 @@ class AzGame
def score
n = @total_tries
p = @tries.keys.length
- t = (100*exp(-(n-1)**2/50**2)).ceil + p
+ t = (100*exp(-((n-1)**2)/(50.0**2))).ceil + p
debug "Total score: #{t}"
ret = Hash.new
@tries.each { |k, a|