示例#1
0
文件: Deck.py 项目: raminsaf/hokm
 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)
示例#2
0
 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)
示例#3
0
文件: Deck.py 项目: raminsaf/hokm
 def getHokmDeck():
   cards = [Card(suit, value) for suit in Suit.getSuits() for value in range(2,15)]
   return Deck(cards)
示例#4
0
文件: Deck.py 项目: raminsaf/hokm
 def toString(self):
   ret = ""
   for suit in Suit.getSuits():
     for card in suit:
       ret = ret + card.toString()
   return ret
示例#5
0
文件: Deck.py 项目: raminsaf/hokm
 def getAllSuitValues(self):
   suitmap = {}
   for suit in Suit.getSuits():
     suitmap[suit] = self.getSuitValue(suit)
   return suitmap
示例#6
0
 def getHokmDeck():
     cards = [
         Card(suit, value) for suit in Suit.getSuits()
         for value in range(2, 15)
     ]
     return Deck(cards)
示例#7
0
 def toString(self):
     ret = ""
     for suit in Suit.getSuits():
         for card in suit:
             ret = ret + card.toString()
     return ret
示例#8
0
 def getAllSuitValues(self):
     suitmap = {}
     for suit in Suit.getSuits():
         suitmap[suit] = self.getSuitValue(suit)
     return suitmap