summaryrefslogtreecommitdiff
path: root/ausbutler/butler.py
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-01-06 00:29:12 +0100
committeremkael <emkael@tlen.pl>2017-01-06 00:29:12 +0100
commit89591b0893bf3ec2ca5124c19ea1c660978d1b40 (patch)
tree8fab348161e89ef44875a8b733e1e1534e5b08b3 /ausbutler/butler.py
parent3698d02c9a57e13070bae5d4b51e40d9879522bb (diff)
Generating segment pages
Diffstat (limited to 'ausbutler/butler.py')
-rw-r--r--ausbutler/butler.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/ausbutler/butler.py b/ausbutler/butler.py
index 2766069..a88776e 100644
--- a/ausbutler/butler.py
+++ b/ausbutler/butler.py
@@ -25,6 +25,12 @@ def get_room(butler, player):
if player in [table.closeE, table.closeW, table.closeN, table.closeS]:
return 'closed'
+def get_line(butler, player):
+ table = butler.table
+ room = get_room(butler, player).upper()
+ direction = 'NS' if player in [table.openN, table.openS, table.closeN, table.closeS] else 'EW'
+ return '%s_%s' % (room, direction)
+
def normalize(butler, opp_factor=0.5):
if butler.board_count == 0:
return 0.0