Ejemplo n.º 1
0
    def played_card(self, card, place):
        """give the card played by place"""
        self.trick_place += 1
        self.trick_place %= 4

        if self.trick_place == 1:
            self.trick = []

        print('played_card = %s' % card)
        self.decks[place] += card
        self.trick.append(str2cards(card)[0])
Ejemplo n.º 2
0
    def test_card_helpers(self):
        """test helper functions"""
        self.assertEqual(str2cards('06-C'), [Club(6), ])

        self.assertEqual(str2cards('01-T;02-S;03-H;04-D'), [Trump(1), Spade(2), Heart(3), Diamond(4)])