source/client/TableView.py
def compressGroups(self, v_scards):
        """ Liverpool specific: Don't have space to display every card. Summarize groups of cards here. """

        # In Liverpool:
        # visible cards structure:
        # a list containing 1 dictionary where each entry in dictionary is a list of serialized cards
        # played with key =(player, group) tuple.  Cards are sorted with wilds in runs appearing where the
        # card they represent would have appeared.
        #
        # Don't reset i_num_sets in new round until player has hit OK key, which resets v_scards.
        if len(v_scards) == 0:
            self.i_num_sets = int(self.Meld_Threshold[self.round_index][0])
        else:
            if len(v_scards[0]) == 0:
                self.i_num_sets = int(self.Meld_Threshold[self.round_index][0])
        self.compressed_info = {}
        i_tot = len(self.player_names)
        for player_name in self.player_names:
            self.compressed_info[player_name] = {}
        #  for each key need to gather s_cards from all players (all idx).  s_card=card.serialize
        for idx in range(i_tot):
            summary = {}
            key_player = self.player_names[idx]
            if len(v_scards) > 0:
                all_visible_one_dictionary = v_scards[0]
                for key, card_group in all_visible_one_dictionary.items():
                    text = ''
                    if key[0] == idx and len(card_group) > 0:
                        # update is player by player, currently updating column of player no. idx.
                        if key[1] < self.i_num_sets:
                            # this is a set
                            card_numbers = []
                            for s_card in card_group:
                                if not s_card[0] in self.wild_numbers:
                                    card_numbers.append(s_card[0])
                            unique_numbers = list(set(card_numbers))
                            if len(unique_numbers) == 1:
                                unique_number = int(unique_numbers[0])
                                if unique_number == 1:
                                    text = "Aces: "
                                elif unique_number <= 10:
                                    text = str(unique_number) + "'s: "
                                elif unique_number == 11:
                                    text = "Jacks: "
                                elif unique_number == 12:
                                    text = "Queens: "
                                elif unique_number == 13:
                                    text = "Kings: "
                            elif len(unique_numbers) > 1:
                                # this should never happen.
                                print('bug in program -- set had multiple non-wild numbers')
                            for s_card in card_group:
                                if not s_card[0] in self.wild_numbers:
                                    text = text + self.cardSuitSymbol(s_card[1]) +  ','
                                else:
                                    text = text + 'Wild,'
                        else:
                            # this is a run, text = suit and list of card numbers, wilds listed as 'Wild'
                            # Doesn't enforce one suit, but does assume there is only one suit.
                            for s_card in card_group:
                                if not s_card[0] in self.wild_numbers:
                                    card_suit = str(s_card[1])
                                    if s_card[0] == 1:
                                        text = text + 'A,'
                                    elif s_card[0] <= 10:
                                        text = text + str(s_card[0]) + ','
                                    elif s_card[0] == 11:
                                        text = text + 'J,'
                                    elif s_card[0] == 12:
                                        text = text + 'Q,'
                                    elif s_card[0] == 13:
                                        text = text + 'K,'
                                else:
                                    text = text + 'Wild,'
                            text = card_suit + ": " + text
                        summary[key[1]] = text
            self.compressed_info[key_player] = summary
 Liverpool specific: Don't have space to display every card. Summarize groups of cards here. 
Liverpool specific: Don't have space to display every card. Summarize groups of cards here.
Liverpool specific : Don ' t have space to display every card . Summarize groups of cards here .
def compressGroups(self, v_scards):
         Don't reset i_num_sets in new round until player has hit OK key, which resets v_scards.
        if len(v_scards) == 0:
            self.i_num_sets = int(self.Meld_Threshold[self.round_index][0])
        else:
            if len(v_scards[0]) == 0:
                self.i_num_sets = int(self.Meld_Threshold[self.round_index][0])
        self.compressed_info = {}
        i_tot = len(self.player_names)
        for player_name in self.player_names:
            self.compressed_info[player_name] = {}
          for each key need to gather s_cards from all players (all idx).  s_card=card.serialize
        for idx in range(i_tot):
            summary = {}
            key_player = self.player_names[idx]
            if len(v_scards) > 0:
                all_visible_one_dictionary = v_scards[0]
                for key, card_group in all_visible_one_dictionary.items():
                    text = ''
                    if key[0] == idx and len(card_group) > 0:
                         update is player by player, currently updating column of player no. idx.
                        if key[1] < self.i_num_sets:
                             this is a set
                            card_numbers = []
                            for s_card in card_group:
                                if not s_card[0] in self.wild_numbers:
                                    card_numbers.append(s_card[0])
                            unique_numbers = list(set(card_numbers))
                            if len(unique_numbers) == 1:
                                unique_number = int(unique_numbers[0])
                                if unique_number == 1:
                                    text = "Aces: "
                                elif unique_number <= 10:
                                    text = str(unique_number) + "'s: "
                                elif unique_number == 11:
                                    text = "Jacks: "
                                elif unique_number == 12:
                                    text = "Queens: "
                                elif unique_number == 13:
                                    text = "Kings: "
                            elif len(unique_numbers) > 1:
                                 this should never happen.
                                print('bug in program -- set had multiple non-wild numbers')
                            for s_card in card_group:
                                if not s_card[0] in self.wild_numbers:
                                    text = text + self.cardSuitSymbol(s_card[1]) +  ','
                                else:
                                    text = text + 'Wild,'
                        else:
                             this is a run, text = suit and list of card numbers, wilds listed as 'Wild'
                             Doesn't enforce one suit, but does assume there is only one suit.
                            for s_card in card_group:
                                if not s_card[0] in self.wild_numbers:
                                    card_suit = str(s_card[1])
                                    if s_card[0] == 1:
                                        text = text + 'A,'
                                    elif s_card[0] <= 10:
                                        text = text + str(s_card[0]) + ','
                                    elif s_card[0] == 11:
                                        text = text + 'J,'
                                    elif s_card[0] == 12:
                                        text = text + 'Q,'
                                    elif s_card[0] == 13:
                                        text = text + 'K,'
                                else:
                                    text = text + 'Wild,'
                            text = card_suit + ": " + text
                        summary[key[1]] = text
            self.compressed_info[key_player] = summary
def compressGroups ( self , v_scards ) : if len ( v_scards ) == 0 : self . i_num_sets = int ( self . Meld_Threshold [ self . round_index ] [ 0 ] ) else : if len ( v_scards [ 0 ] ) == 0 : self . i_num_sets = int ( self . Meld_Threshold [ self . round_index ] [ 0 ] ) self . compressed_info = { } i_tot = len ( self . player_names ) for player_name in self . player_names : self . compressed_info [ player_name ] = { } for idx in range ( i_tot ) : summary = { } key_player = self . player_names [ idx ] if len ( v_scards ) > 0 : all_visible_one_dictionary = v_scards [ 0 ] for key , card_group in all_visible_one_dictionary . items ( ) : text = '' if key [ 0 ] == idx and len ( card_group ) > 0 : if key [ 1 ] < self . i_num_sets : card_numbers = [ ] for s_card in card_group : if not s_card [ 0 ] in self . wild_numbers : card_numbers . append ( s_card [ 0 ] ) unique_numbers = list ( set ( card_numbers ) ) if len ( unique_numbers ) == 1 : unique_number = int ( unique_numbers [ 0 ] ) if unique_number == 1 : text = "Aces: " elif unique_number <= 10 : text = str ( unique_number ) + "'s: " elif unique_number == 11 : text = "Jacks: " elif unique_number == 12 : text = "Queens: " elif unique_number == 13 : text = "Kings: " elif len ( unique_numbers ) > 1 : print ( 'bug in program -- set had multiple non-wild numbers' ) for s_card in card_group : if not s_card [ 0 ] in self . wild_numbers : text = text + self . cardSuitSymbol ( s_card [ 1 ] ) + ',' else : text = text + 'Wild,' else : for s_card in card_group : if not s_card [ 0 ] in self . wild_numbers : card_suit = str ( s_card [ 1 ] ) if s_card [ 0 ] == 1 : text = text + 'A,' elif s_card [ 0 ] <= 10 : text = text + str ( s_card [ 0 ] ) + ',' elif s_card [ 0 ] == 11 : text = text + 'J,' elif s_card [ 0 ] == 12 : text = text + 'Q,' elif s_card [ 0 ] == 13 : text = text + 'K,' else : text = text + 'Wild,' text = card_suit + ": " + text summary [ key [ 1 ] ] = text self . compressed_info [ key_player ] = summary
Liverpool specific: Don't have space to display every card.
Liverpool specific : Don ' t have space to display every card .
""" Liverpool specific: Don't have space to display every card. Summarize groups of cards here. """ # In Liverpool: # visible cards structure: # a list containing 1 dictionary where each entry in dictionary is a list of serialized cards # played with key =(player, group) tuple.  Cards are sorted with wilds in runs appearing where the # card they represent would have appeared. # # Don't reset i_num_sets in new round until player has hit OK key, which resets v_scards. #  for each key need to gather s_cards from all players (all idx).  s_card=card.serialize # update is player by player, currently updating column of player no. idx. # this is a set # this should never happen. # this is a run, text = suit and list of card numbers, wilds listed as 'Wild' # Doesn't enforce one suit, but does assume there is only one suit.
self
v_scards