def order(self): suitmap = { suit:[] for suit in Suit.getSuits() } for card in self._cards: suitmap[card.getSuit()].append(card) self._cards = [] for suit in Suit.getSuits(): self._cards += sorted(suitmap[suit], key = lambda x: x.getValue(), reverse = True)
def order(self): suitmap = {suit: [] for suit in Suit.getSuits()} for card in self._cards: suitmap[card.getSuit()].append(card) self._cards = [] for suit in Suit.getSuits(): self._cards += sorted(suitmap[suit], key=lambda x: x.getValue(), reverse=True)
def getHokmDeck(): cards = [Card(suit, value) for suit in Suit.getSuits() for value in range(2,15)] return Deck(cards)
def toString(self): ret = "" for suit in Suit.getSuits(): for card in suit: ret = ret + card.toString() return ret
def getAllSuitValues(self): suitmap = {} for suit in Suit.getSuits(): suitmap[suit] = self.getSuitValue(suit) return suitmap
def getHokmDeck(): cards = [ Card(suit, value) for suit in Suit.getSuits() for value in range(2, 15) ] return Deck(cards)
def toString(self): ret = "" for suit in Suit.getSuits(): for card in suit: ret = ret + card.toString() return ret
def getAllSuitValues(self): suitmap = {} for suit in Suit.getSuits(): suitmap[suit] = self.getSuitValue(suit) return suitmap