Exemplo n.º 1
0
 def __construct_preflop_key(self, card_strs):
     cards = sorted(Card.hand_to_binary(card_strs), reverse=True)
     #print Card.print_pretty_cards(cards)
     key = ''.join([Card.int_to_str(card)[0] for card in cards])
     if Card.get_suit_int(cards[0]) == Card.get_suit_int(cards[1]):
         key = key + "s"
     else:
         key = key + "o"
     return key
Exemplo n.º 2
0
 def assign_board(self, card_strs):
     # card_strs suit must be lower case: ['Ah', 'Js', '7h']
     for card in card_strs:
         if Card.hand_to_binary([card])[0] not in self._board:
             self._board.append(Card.new(card))
     self._remove_from_deck(card_strs)
Exemplo n.º 3
0
 def _remove_from_deck(self, card_strs):
     cards = Card.hand_to_binary(card_strs)
     for card in cards:
         if card in self._deck.cards:
             self._deck.cards.remove(card)