本文整理汇总了Python中hand.Hand.find_lowest_combination方法的典型用法代码示例。如果您正苦于以下问题:Python Hand.find_lowest_combination方法的具体用法?Python Hand.find_lowest_combination怎么用?Python Hand.find_lowest_combination使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hand.Hand
的用法示例。
在下文中一共展示了Hand.find_lowest_combination方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_find_straight_going_up
# 需要导入模块: from hand import Hand [as 别名]
# 或者: from hand.Hand import find_lowest_combination [as 别名]
def test_find_straight_going_up(self):
cards = ' 4_Sw, Phoenix, 5_Pa, 6_Pa, 7_Sw, 8_Pa'
hand = Hand(cards_string=cards)
combination = hand.find_lowest_combination(5, 'STRAIGHT')
print(combination)
self.assertIsNotNone(combination)
combination = hand.find_lowest_combination(5, 'STRAIGHT', length=6)
print(combination)
self.assertIsNotNone(combination)
示例2: test_find_straight_with_card_discard
# 需要导入模块: from hand import Hand [as 别名]
# 或者: from hand.Hand import find_lowest_combination [as 别名]
def test_find_straight_with_card_discard(self):
cards = ' 4_Sw, 6_Pa, 7_Sw, 8_Pa, 9_Sw, 10_Pa'
hand = Hand(cards_string=cards)
combination = hand.find_lowest_combination(3, 'STRAIGHT')
print(combination)
self.assertIsNotNone(combination)
示例3: test_find_straight_with_phoenix
# 需要导入模块: from hand import Hand [as 别名]
# 或者: from hand.Hand import find_lowest_combination [as 别名]
def test_find_straight_with_phoenix(self):
cards = '2_Sw, 3_Pa, Phoenix, 5_Pa, 6_Pa'
hand = Hand(cards_string=cards)
combination = hand.find_lowest_combination(5, 'STRAIGHT')
print(combination)
self.assertIsNotNone(combination)
示例4: test_find_squarebomb
# 需要导入模块: from hand import Hand [as 别名]
# 或者: from hand.Hand import find_lowest_combination [as 别名]
def test_find_squarebomb(self):
cards = 'Phoenix, 2_Pa, 3_Pa, 4_Pa, 5_Pa, 5_Sw, 5_Ja, 5_St'
hand = Hand(cards_string=cards)
combination = hand.find_lowest_combination(4, 'SQUAREBOMB')
print(combination)
self.assertIsNotNone(combination)
示例5: test_find_straight
# 需要导入模块: from hand import Hand [as 别名]
# 或者: from hand.Hand import find_lowest_combination [as 别名]
def test_find_straight(self):
cards = '2_Sw, 3_Pa, 4_Pa, 5_Pa, 6_Pa, 5_Ja, 5_St'
hand = Hand(cards_string=cards)
combination = hand.find_lowest_combination(5, 'STRAIGHT')
print(combination)
self.assertIsNotNone(combination)
示例6: test_find_low_pair_with_phoenix
# 需要导入模块: from hand import Hand [as 别名]
# 或者: from hand.Hand import find_lowest_combination [as 别名]
def test_find_low_pair_with_phoenix(self):
cards = 'Phoenix, 2_Pa, 3_Pa, 4_Pa, 5_Pa'
hand = Hand(cards_string=cards)
combination = hand.find_lowest_combination(1, 'PAIR')
print(combination)
self.assertTrue(combination.phoenix_flag)
示例7: test_find_trio
# 需要导入模块: from hand import Hand [as 别名]
# 或者: from hand.Hand import find_lowest_combination [as 别名]
def test_find_trio(self):
cards = 'Phoenix, 2_Pa, 3_Pa, 4_Pa, 5_Pa, 5_Sw, 5_Ja, 5_St'
hand = Hand(cards_string=cards)
combination = hand.find_lowest_combination(4, 'TRIO')
print(combination)
self.assertIsNotNone(combination)
示例8: test_steps_with_phoenix_not_need
# 需要导入模块: from hand import Hand [as 别名]
# 或者: from hand.Hand import find_lowest_combination [as 别名]
def test_steps_with_phoenix_not_need(self):
cards = '5_Sw, 5_Pa, 6_Sw, Phoenix, 7_Sw, 7_Pa, 8_Sw, 8_Pa'
hand = Hand(cards_string=cards)
combination = hand.find_lowest_combination(2, 'STEPS')
print(combination)
self.assertEqual(combination.type, 'STEPS')
示例9: test_find_low_pair
# 需要导入模块: from hand import Hand [as 别名]
# 或者: from hand.Hand import find_lowest_combination [as 别名]
def test_find_low_pair(self):
cards = 'Phoenix, 2_Pa, 3_Pa, 4_Pa, 5_Pa, 5_Sw, 5_Ja, 5_St'
hand = Hand(cards_string=cards)
combination = hand.find_lowest_combination(1, 'PAIR')
print(combination)
self.assertFalse(combination.phoenix_flag)
示例10: test_find_long_steps_with_phoenix
# 需要导入模块: from hand import Hand [as 别名]
# 或者: from hand.Hand import find_lowest_combination [as 别名]
def test_find_long_steps_with_phoenix(self):
cards = '5_Sw, 5_Pa, 6_Sw, 6_Pa, 7_Sw, Phoenix'
hand = Hand(cards_string=cards)
combination = hand.find_lowest_combination(2, 'STEPS', length=3)
print(combination)
self.assertEqual(combination.type, 'STEPS')
示例11: test_find_steps
# 需要导入模块: from hand import Hand [as 别名]
# 或者: from hand.Hand import find_lowest_combination [as 别名]
def test_find_steps(self):
cards = '2_Sw, 2_Pa, 3_Sw,3_Pa'
hand = Hand(cards_string=cards)
combination = hand.find_lowest_combination(2, 'STEPS')
print(combination)
self.assertEqual(combination.type, 'STEPS')
示例12: test_play_on_dragon
# 需要导入模块: from hand import Hand [as 别名]
# 或者: from hand.Hand import find_lowest_combination [as 别名]
def test_play_on_dragon(self):
cards = 'Phoenix'
hand = Hand(cards_string=cards)
print('DRAGON')
combination = hand.find_lowest_combination(Dragon().power, 'SINGLE')
print('DRAGON', combination)
self.assertIsNotNone(combination)
示例13: test_find_steps_no_solution_with_pairs
# 需要导入模块: from hand import Hand [as 别名]
# 或者: from hand.Hand import find_lowest_combination [as 别名]
def test_find_steps_no_solution_with_pairs(self):
cards = '6_Sw, 6_Pa'
hand = Hand(cards_string=cards)
combination = hand.find_lowest_combination(2, 'STEPS')
print(combination)
self.assertIsNone(combination)
示例14: test_find_long_steps
# 需要导入模块: from hand import Hand [as 别名]
# 或者: from hand.Hand import find_lowest_combination [as 别名]
def test_find_long_steps(self):
cards = '5_Sw, 5_Pa, 6_Sw,6_Pa, 7_Sw, 7_Pa'
hand = Hand(cards_string=cards)
straight = hand.find_straight(hand, 2, 3)
print(straight)
combination = hand.find_lowest_combination(2, 'STEPS', 3)
print(combination)
self.assertEqual(combination.type, 'STEPS')
示例15: test_stght
# 需要导入模块: from hand import Hand [as 别名]
# 或者: from hand.Hand import find_lowest_combination [as 别名]
def test_stght(self):
cards = 'Dog, Phoenix, Mahjong, 2_St, 3_Sw, 3_Pa,4_Pa, 5_St, 6_Sw, 6_Ja, 8_Pa, 9_Pa, J_Sw, K_Sw, A_Ja'
hand = Hand(cards_string=cards)
combination = hand.find_lowest_combination(0, 'STRAIGHT')
self.assertEqual(combination.type, 'STRAIGHT')