summaryrefslogtreecommitdiff
path: root/ausbutler/butler.py
diff options
context:
space:
mode:
Diffstat (limited to 'ausbutler/butler.py')
-rw-r--r--ausbutler/butler.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/ausbutler/butler.py b/ausbutler/butler.py
index fb78fdb..2fae840 100644
--- a/ausbutler/butler.py
+++ b/ausbutler/butler.py
@@ -32,3 +32,10 @@ def get_room(butler, player):
if player in [table.closeE, table.closeW, table.closeN, table.closeS]:
return 'closed'
+def normalize(butler):
+ if butler.board_count == 0:
+ return 0.0
+ return (
+ butler.cut_score / butler.board_count
+ + butler.opp_score * config['opponent_factor']
+ ) * butler.board_count