Exemple #1
0
    def check_fast_fold(self, h, p, mouse):
        self.gui_signals.signal_status.emit("Check for fast fold")
        self.gui_signals.signal_progressbar_reset.emit()
        if self.gameStage == "PreFlop":
            m = MonteCarlo()
            crd1, crd2 = m.get_two_short_notation(self.mycards)
            crd1 = crd1.upper()
            crd2 = crd2.upper()
            sheet_name = str(self.position_utg_plus + 1)
            if sheet_name == '6': return True
            sheet = h.preflop_sheet[sheet_name]
            sheet['Hand'] = sheet['Hand'].apply(lambda x: str(x).upper())
            handlist = set(sheet['Hand'].tolist())

            found_card = ''

            if crd1 in handlist:
                found_card = crd1
            elif crd2 in handlist:
                found_card = crd2
            elif crd1[0:2] in handlist:
                found_card = crd1[0:2]

            if found_card == '':
                mouse_target = "Fold"
                mouse.mouse_action(mouse_target, self.tlc)
                log.info("-------- FAST FOLD -------")
                return False

        return True
    def check_fast_fold(self, h, p, mouse):
        if self.gameStage == "PreFlop":
            m = MonteCarlo()
            crd1, crd2 = m.get_two_short_notation(self.mycards)
            crd1 = crd1.upper()
            crd2 = crd2.upper()
            sheet_name = str(self.position_utg_plus + 1)
            if sheet_name == '6': return True
            sheet = h.preflop_sheet[sheet_name]
            sheet['Hand'] = sheet['Hand'].apply(lambda x: str(x).upper())
            handlist = set(sheet['Hand'].tolist())

            found_card = ''

            if crd1 in handlist:
                found_card = crd1
            elif crd2 in handlist:
                found_card = crd2
            elif crd1[0:2] in handlist:
                found_card = crd1[0:2]

            if found_card == '':
                mouse_target = "Fold"
                mouse.mouse_action(mouse_target, self.tlc)
                self.logger.info("-------- FAST FOLD -------")
                return False

        return True
"""Used to create equity rankinks for all 52 preflop card combinations"""

import json
import logging
import time
from collections import OrderedDict
from operator import itemgetter

from poker.decisionmaker.montecarlo_python import MonteCarlo

logger = logging.getLogger(__name__)

if __name__ == '__main__':
    Simulation = MonteCarlo()

    equity_dict = {}

    hands = '23456789TJQKA'
    suits = ['D', 'H']
    for suit1 in suits:
        for i in range(len(hands)):  # pylint: disable=consider-using-enumerate
            h1 = hands[i]
            for j in range(i, len(hands)):
                h2 = hands[j]
                card1 = h1 + suit1
                card2 = h2 + suits[0]
                cardlist = [card1, card2]
                my_cards = [(cardlist)]

                if not (suit1 == suits[0] and card1 == card2):
                    cards_on_table = []