diff options
author | emkael <emkael@tlen.pl> | 2020-04-21 17:08:06 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2020-04-21 17:08:06 +0200 |
commit | 3b34542875228db34fd8f7890b0f5e81f1fb9593 (patch) | |
tree | ba9b82689dc45eed55e87a2dec5c57d18e0778d4 /dealconvert/formats/lin.py | |
parent | e8d2b7af0f3dc6bea1cac2deb1cd17a72a437294 (diff) |
LIN hand layout always starts from South
Diffstat (limited to 'dealconvert/formats/lin.py')
-rw-r--r-- | dealconvert/formats/lin.py | 5 |
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: |