def CardStrListToCardIntSet(cards): return set([Card.new(card_str) for card_str in cards])
def CardStrListToCardIntList(cards): return [Card.new(card_str) for card_str in cards]
from doudizhu import Card, new_game cards_groups = new_game() cards_groups for cards_group in cards_groups: Card.print_pretty_cards(cards_group)
def test_cards_without_suit(self): test_cards = [ Card.new('3s'), Card.new('3h'), Card.new('3d'), Card.new('3c'), Card.new('10c'), Card.new('10d'), Card.new('10h'), Card.new('10s'), Card.new('BJ'), Card.new('CJ'), ] ret = Card.cards_without_suit(test_cards) self.assertEqual(ret, '3-3-3-3-10-10-10-10-BJ-CJ')
def convert(vpx): """将传入的牌idlist转换为字符串形式""" card_ints = Card.card_ints_from_others(vpx) return Card.cards_without_suit(card_ints)