summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2020-04-21 17:08:06 +0200
committeremkael <emkael@tlen.pl>2020-04-21 17:08:06 +0200
commit3b34542875228db34fd8f7890b0f5e81f1fb9593 (patch)
treeba9b82689dc45eed55e87a2dec5c57d18e0778d4
parente8d2b7af0f3dc6bea1cac2deb1cd17a72a437294 (diff)
LIN hand layout always starts from South
-rw-r--r--dealconvert/formats/lin.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/dealconvert/formats/lin.py b/dealconvert/formats/lin.py
index c2f3a0e..91a6b3d 100644
--- a/dealconvert/formats/lin.py
+++ b/dealconvert/formats/lin.py
@@ -62,11 +62,10 @@ class LINFormat(DealFormat):
def _parse_md_field(self, value):
try:
- first_hand = int(value[0])-1 # 0 = S, 1 = W, 2 = N, 3 = E
hands = value[1:].split(',')
layout = [[], [], [], []]
for i, hand in enumerate(hands):
- layout[(first_hand+i+2)%4] = self._parse_md_hand(hand) # N <-> S, E <-> W
+ layout[(i+2)%4] = self._parse_md_hand(hand) # hands always start from S
for j, single_hand in enumerate(layout):
if not sum([len(suit) for suit in single_hand]): # fill 4th hand if necessary
for k, suit in enumerate(single_hand):
@@ -103,7 +102,7 @@ class LINFormat(DealFormat):
dealer = (deal.dealer + 3) % 4 or 4
layout = ''
for i in range(0, 4):
- for s, suit in enumerate(deal.hands[(i+dealer-3) % 4]):
+ for s, suit in enumerate(deal.hands[(i+2) % 4]):
layout += 'SHDC'[s]
layout += ''.join(suit)
if i < 3: