summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dealconvert/dto.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/dealconvert/dto.py b/dealconvert/dto.py
index e51f052..37585d8 100644
--- a/dealconvert/dto.py
+++ b/dealconvert/dto.py
@@ -20,3 +20,20 @@ class Deal(object):
[[],[],[],[]],
[[],[],[],[]]]
self.vulnerable = {'NS': False, 'EW': False}
+
+ def get_dealer(self, board_no):
+ return (board_no - 1) % 4
+
+ def get_vulnerability(self, board_no):
+ board_no = board_no % 16
+ vuln = {'NS': [False,
+ False, True, False, True,
+ True, False, True, False,
+ False, True, False, True,
+ True, False, True],
+ 'EW': [True,
+ False, False, True, True,
+ False, True, True, False,
+ True, True, False, False,
+ True, False, False]}
+ return { pair: vuln[pair][board_no] for pair in vuln }