def playCardsForBottom(self, player, numCards, c): cardsPlayed = SortedCardCollection() while cardsPlayed.size() != numCards: if not cardsPlayed.isSubSet(player) or cardsPlayed.size() > 8: cardsPlayed.removeAll() self.inputCardsPlayed(cardsPlayed, player) cards = [] for i in range(numCards): cards.append(cardsPlayed.get(i)) return cards
def playCards(self, player, currentTrick): cardsPlayed = SortedCardCollection() valid = False combo = None while not valid: self.inputCardsPlayed(cardsPlayed, player) combo = Combo(player, cardsPlayed) valid = self.validateCardsPlayed(combo, currentTrick, player) if not valid: print("Invalid!") cardsPlayed.removeAll() else: print("VALID!") currentTrick.add(combo) player.removeCards(cardsPlayed)