本文整理汇总了Python中hand.Hand.is_straight方法的典型用法代码示例。如果您正苦于以下问题:Python Hand.is_straight方法的具体用法?Python Hand.is_straight怎么用?Python Hand.is_straight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hand.Hand
的用法示例。
在下文中一共展示了Hand.is_straight方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_straight_flash
# 需要导入模块: from hand import Hand [as 别名]
# 或者: from hand.Hand import is_straight [as 别名]
def test_straight_flash(self):
deck = Deck()
deck.get_new_deck()
community_cards = []
community_cards.append (deck.deal())
community_cards.append (deck.deal())
community_cards.append (Card('2', 'D'))
community_cards.append (Card('3', 'D'))
community_cards.append (Card('4', 'D'))
my_hand = Hand(community_cards)
my_hand.add (Card('5', 'D'))
my_hand.add (Card('6', 'D'))
assert my_hand.is_straight() and my_hand.is_flush()
示例2: xrange
# 需要导入模块: from hand import Hand [as 别名]
# 或者: from hand.Hand import is_straight [as 别名]
for i in xrange(int(total)):
deck.get_new_deck()
community_cards = []
community_cards.append (community_cards1 or deck.deal())
community_cards.append (community_cards2 or deck.deal())
community_cards.append (community_cards3 or deck.deal())
community_cards.append (community_cards4 or deck.deal())
community_cards.append (community_cards5 or deck.deal())
my_hand = Hand(community_cards)
my_hand.add (my_cards1)
my_hand.add (my_cards2)
if my_hand.is_flush(): count_my_flushes += 1.0
if my_hand.is_straight(): count_my_straights += 1.0
if my_hand.four_of_a_kind(): count_my_four_of_a_kind += 1.0
if my_hand.three_of_a_kind(): count_my_three_of_a_kind += 1.0
if my_hand.one_pair(): count_my_one_pair += 1.0
count_my_hand_strength += my_hand.get_strength()
count_their_straights = 0
count_their_flushes = 0
count_their_four_of_a_kind = 0
count_their_three_of_a_kind = 0
count_their_one_pair = 0
count_their_hand_strength = 0
deck = Deck()
for i in xrange(int(total)):
deck.get_new_deck()