本文整理汇总了Python中deuces.Card.prime_product_from_hand方法的典型用法代码示例。如果您正苦于以下问题:Python Card.prime_product_from_hand方法的具体用法?Python Card.prime_product_from_hand怎么用?Python Card.prime_product_from_hand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类deuces.Card
的用法示例。
在下文中一共展示了Card.prime_product_from_hand方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Evaluator
# 需要导入模块: from deuces import Card [as 别名]
# 或者: from deuces.Card import prime_product_from_hand [as 别名]
evaluator = Evaluator()
cards = ['Ah', 'Kh', 'Qh', 'Jh', 'Th', '9h', '8h',
'7h', '6h', '5h', '4h', '3h', '2h']
perms = []
for i in xrange(len(cards)):
for j in xrange(i, len(cards)):
for k in xrange(j, len(cards)):
perms.append([Card.new(cards[i]),
Card.new(cards[j]),
Card.new(cards[k])])
front_lookup = {}
for perm in perms:
# Add the two lowest unpairing cards
hand = copy(perm)
hand.append(get_lowest_unpairing_card(hand))
hand.append(get_lowest_unpairing_card(hand))
prime_prod = Card.prime_product_from_hand(perm)
rank = evaluator.evaluate(hand, []) + 1
kicker = Card.get_rank_int(perm[0]) * 0.01 + \
Card.get_rank_int(perm[1]) * 0.0001 + \
Card.get_rank_int(perm[2]) * 0.000001
front_lookup[prime_prod] = rank - kicker
with open('res/front_lookup.p', 'wb') as f:
pickle.dump(front_lookup, f)
示例2: _three
# 需要导入模块: from deuces import Card [as 别名]
# 或者: from deuces.Card import prime_product_from_hand [as 别名]
def _three(self, cards):
prime = Card.prime_product_from_hand(cards)
return FRONT_LOOKUP[prime]