Esempio n. 1
0
def Me_1_pair_Ranking(List=None):
    """
    Best Rank: (1, 14) Example: ([10,8,2,5],14,10)
    second index is my Kicker card
    ([14,14,10,8,5],10,11): (1, 11)
    """

    if List == None:
        if c.flop_stage == True and c.turn_stage == False:
            List = [c.board_card_1th, c.board_card_2th, c.board_card_3th]
        elif c.turn_stage == True and c.river_stage == False:
            List = [
                c.board_card_1th, c.board_card_2th, c.board_card_3th,
                c.board_card_4th
            ]
        elif c.river_stage == True:
            List = [
                c.board_card_1th, c.board_card_2th, c.board_card_3th,
                c.board_card_4th, c.board_card_5th
            ]

    if Me_1_pair(List) == True:

        List = [n(i) for i in List]
        List.sort(reverse=True)

        List = [i for i in List if List.count(i) == 1]
        if List.count(n(c.my_1th_card)) == 1:
            My_Card = c.my_1th_card
            My_Kicker = c.my_2th_card
        elif List.count(n(c.my_2th_card)) == 1:
            My_Card = c.my_2th_card
            My_Kicker = c.my_1th_card

        return (Cards_Matching(List, My_Card), n(My_Kicker))
def Me_1_pair_Ranking(board_list=None):
    """
    Best Rank: (1, 14) Example: ([10,8,2,5],14,10)
    second index is my Kicker card
    ([14,14,10,8,5],10,11): (1, 11)
    """

    if board_list == None:
        board_list = board_cards_list()[:]
    if board_list == []:
        return None

    if Me_1_pair(board_list) == True:

        board_list = [n(i) for i in board_list]
        board_list.sort(reverse=True)

        board_list = [i for i in board_list if board_list.count(i) == 1]
        if board_list.count(n(c.my_1th_card)) == 1:
            My_Card = c.my_1th_card
            My_Kicker = c.my_2th_card
        elif board_list.count(n(c.my_2th_card)) == 1:
            My_Card = c.my_2th_card
            My_Kicker = c.my_1th_card

        return (Cards_Matching(board_list, My_Card), n(My_Kicker))
Esempio n. 3
0
def Me_pocket_3_of_kinds(List=None):

    if List == None:
        if c.flop_stage == True and c.turn_stage == False:
            List = [c.board_card_1th, c.board_card_2th, c.board_card_3th]
        elif c.turn_stage == True and c.river_stage == False:
            List = [
                c.board_card_1th, c.board_card_2th, c.board_card_3th,
                c.board_card_4th
            ]
        elif c.river_stage == True:
            List = [
                c.board_card_1th, c.board_card_2th, c.board_card_3th,
                c.board_card_4th, c.board_card_5th
            ]

    List = [n(i) for i in List]

    if List.count(n(c.my_1th_card)) == 1 and List.count(n(
            c.my_2th_card)) == 1 and n(c.my_1th_card) == n(
                c.my_2th_card) and (Table_Individual(List)
                                    or Table_4_of_kinds(List)):
        return True
    else:
        return False
def Me_3_of_kinds_Ranking(board_list=None):
    """
    Best Rank: (1, 14) Example: ([5,6,6,8],6 ,14 )
    second index is my Kicker card
    First index rank: 1,2
    First index at Table_full_house or Table_1_pair is: Always 1
    First index at Table_2_pair first index is: 1,2. At Table_2_pair second index will be returned but not usable.
    """

    if board_list == None:
        board_list = board_cards_list()[:]
    if board_list == []:
        return None

    if Me_3_of_kinds(board_list) == True:

        board_list = [n(i) for i in board_list]
        board_list.sort(reverse=True)

        if board_list.count(n(c.my_1th_card)) == 2:
            My_Card = c.my_1th_card
            My_Kicker = c.my_2th_card
        elif board_list.count(n(c.my_2th_card)) == 2:
            My_Card = c.my_2th_card
            My_Kicker = c.my_2th_card

        Card = []
        for i in range(len(board_list)):
            if board_list.count(
                    board_list[i]) == 2 and board_list[i] not in Card:
                Card.append(board_list[i])
        Card.sort(reverse=True)

        return (Cards_Matching(Card, My_Card), n(My_Kicker))
def cards_ranking(
    My_Card,
    board_list=None
):  # screenshot va be cheat sheet e pair functions ezafe shavad
    """
    Ranks: 1,...,6
    It does not return None at all. 
    This is an independant function and it does not have any True or False function
    1: (12, [9,8,5]). 1: (12, [12,11,10]). 1: (12, [12,12,10]). 1: (5, []) 
    2: (10, [12,10,7]). 4: (5, [12,10,7]). 6: (3, [12,11,7,6,5])
    """
    if board_list == None:
        board_list = board_cards_list()[:]
    if board_list == []:
        return 1

    board_list = [n(i) for i in board_list]

    My_Card = n(My_Card)

    board_list = list(set(board_list))
    board_list.sort(reverse=True)
    Cards_Ranking = 1
    for i in range(len(board_list)):
        if My_Card >= board_list[i]:
            return Cards_Ranking
        else:
            Cards_Ranking = Cards_Ranking + 1
    return Cards_Ranking
Esempio n. 6
0
def Me_Open_str_draw_1_cards_Ranking(table_cards_list=None):
    """ Rank 1,2 & None """
    global flop_stage , turn_stage , river_stage ,\
    board_card_1th , board_card_2th , board_card_3th , board_card_4th , board_card_5th , my_1th_card , my_2th_card
    load_variables()

    if table_cards_list == None:
        if flop_stage == True and turn_stage == False:
            table_cards_list = [board_card_1th, board_card_2th, board_card_3th]
        elif turn_stage == True and river_stage == False:
            table_cards_list = [
                board_card_1th, board_card_2th, board_card_3th, board_card_4th
            ]
        elif river_stage == True:
            table_cards_list = [
                board_card_1th, board_card_2th, board_card_3th, board_card_4th,
                board_card_5th
            ]

    if Me_Open_str_draw_2_cards( table_cards_list ) == True \
       or Me_str_2_cards( table_cards_list ) == True :
        return None

    rank = 0
    for i in open_str_draw_1_Cards_list(table_cards_list):
        rank += 1
        if n(my_1th_card) == i or n(my_2th_card) == i:
            return rank
Esempio n. 7
0
def Me_Open_str_draw_1_cards(table_cards_list=None):
    """
    if Me_str == True: retun False
    ( [7,8,9] ,2 ,10 ): True.  ( [6,7,8,9] ,2 ,10 ): False
    """
    global flop_stage , turn_stage , river_stage ,\
    board_card_1th , board_card_2th , board_card_3th , board_card_4th , board_card_5th , my_1th_card , my_2th_card
    load_variables()

    if table_cards_list == None:
        if flop_stage == True and turn_stage == False:
            table_cards_list = [board_card_1th, board_card_2th, board_card_3th]
        elif turn_stage == True and river_stage == False:
            table_cards_list = [
                board_card_1th, board_card_2th, board_card_3th, board_card_4th
            ]
        elif river_stage == True:
            table_cards_list = [
                board_card_1th, board_card_2th, board_card_3th, board_card_4th,
                board_card_5th
            ]

    if Me_Open_str_draw_2_cards( table_cards_list ) == True \
       or Me_str_2_cards( table_cards_list ) == True :
        return False

    for i in open_str_draw_1_Cards_list(table_cards_list):
        if n(my_1th_card) == i or n(my_2th_card) == i:
            return True
    return False
Esempio n. 8
0
def Me_Flush_by_5_table_cards(board_list=None) :
    """
    ( ['6 c','8 c','10 c','K c','A c'] , '2 c' , '3 c' ) return False
    ( ['6 c','8 c','10 c','K c','A c'] , 'Q c' , '7 c' ) return True
    """
    
    if board_list == None :
        board_list = board_cards_list()[:]
    if board_list == []:
        return False
        
    sign1 = 0
    sign2 = 0
    for i in board_list :
        if s(config.my_1th_card) == s(i) :
            sign1 += 1
        if s(config.my_2th_card) == s(i) :
            sign2 += 1

    if sign1 == 5 and sign2 == 5:
        My_highest = max(n(config.my_1th_card),n(config.my_2th_card))
    elif sign1 == 5 :
        My_highest = n(config.my_1th_card)
    elif sign2 == 5 :
        My_highest = n(config.my_2th_card)
    sign_List = []
    for i in board_list :
        sign_List.append(n(i))
    if (sign1 == 5 or sign2 == 5) and My_highest > min(sign_List) :
        return True
    return False
Esempio n. 9
0
def hand2():
    """ QQ,JJ """
    global my_1th_card, my_2th_card
    load_variables()
    if n(my_1th_card) == n(my_2th_card) and 11 <= n(my_1th_card) <= 12:
        #shout("hand2 is True")
        return True
    else:
        return None
Esempio n. 10
0
def hand4():
    """ 88,77,...,22 """
    global my_1th_card, my_2th_card
    load_variables()
    if n(my_1th_card) == n(my_2th_card) and 2 <= n(my_1th_card) <= 8:
        #shout("hand4 is True")
        return True
    else:
        return None
Esempio n. 11
0
def hand3():
    """ 1010,99 """
    global my_1th_card, my_2th_card
    load_variables()
    if n(my_1th_card) == n(my_2th_card) and 9 <= n(my_1th_card) <= 10:
        #shout("hand3 is True")
        return True
    else:
        return None
Esempio n. 12
0
def hand1():
    """ AA,KK """
    global my_1th_card, my_2th_card
    load_variables()
    if n(my_1th_card) == n(my_2th_card) and 13 <= n(my_1th_card) <= 14:
        #shout("hand1 is True")
        return True
    else:
        return None
Esempio n. 13
0
def hand8():
    """ AK,...,1010,...22,...,(65 rang) Blind position call 2 blind raise, otherwise fold that """
    global my_1th_card, my_2th_card
    load_variables()
    if not (hand1() or hand2()):
        if hand3() or hand4() \
        or hand5() or hand6() \
        or ( n( my_1th_card ) >= 5 and n( my_2th_card ) >= 5 and \
             s( my_1th_card ) == s( my_2th_card ) and abs( n( my_2th_card ) - n( my_1th_card ) ) == 1 ) :
            #shout("hand8 is True")
            return True
    else:
        return None
def Me_3_of_kinds(board_list=None):

    if board_list == None:
        board_list = board_cards_list()[:]
    if board_list == []:
        return False

    board_list = [n(i) for i in board_list]

    if (board_list.count( n(c.my_1th_card) ) == 2 and board_list.count( n(c.my_2th_card) ) == 0) \
       or (board_list.count( n(c.my_1th_card) ) == 0 and board_list.count( n(c.my_2th_card) ) == 2):
        return True
    else:
        return False
Esempio n. 15
0
def Me_str_2_cards_Ranking(table_cards_list=None):
    """
    Rank 1,2,3 & None
    1 ([7, 8, 9, 11], 10, 12).  2 ([7, 8, 9], 10, 6).  3 ([7, 8, 9], 5, 6)
    """
    global flop_stage , turn_stage , river_stage ,\
    board_card_1th , board_card_2th , board_card_3th , board_card_4th , board_card_5th , my_1th_card , my_2th_card
    load_variables()

    if table_cards_list == None:
        if flop_stage == True and turn_stage == False:
            table_cards_list = [board_card_1th, board_card_2th, board_card_3th]
        elif turn_stage == True and river_stage == False:
            table_cards_list = [
                board_card_1th, board_card_2th, board_card_3th, board_card_4th
            ]
        elif river_stage == True:
            table_cards_list = [
                board_card_1th, board_card_2th, board_card_3th, board_card_4th,
                board_card_5th
            ]

    if n(my_1th_card) == n(my_2th_card):
        return None
    rank = 0
    for i in str_2_Cards_list(table_cards_list):
        rank += 1
        if n(my_1th_card) in i and n(my_2th_card) in i:
            return rank
        if n(my_1th_card) == 14:
            if 1 in i and n(my_2th_card) in i:
                return rank
        if n(my_2th_card) == 14:
            if n(my_1th_card) in i and 1 in i:
                return rank
Esempio n. 16
0
def hand7():
    """ 72,73,...,96,107 (gheir rang)  Fold small blind position (otherwise Small always call Blind) """
    global my_1th_card, my_2th_card
    load_variables()
    if not( hand1() or hand2() or hand3() or \
            hand4() or hand5() or hand6() \
            or s( my_1th_card ) == s( my_2th_card ) ) :
        for i in range(2, 8):
            if i in ( n( my_1th_card ) , n( my_2th_card ) )  and abs( n( my_2th_card ) - n( my_1th_card ) ) >= 3 \
            and n( my_1th_card ) <= 10 and n( my_2th_card ) <= 10 :
                #shout("hand7 is True")
                return True
    else:
        return None
def Me_2_pair(board_list=None):

    if board_list == None:
        board_list = board_cards_list()[:]
    if board_list == []:
        return False

    board_list = [n(i) for i in board_list]

    if board_list.count(n(c.my_1th_card)) == 1 and board_list.count(
            n(c.my_2th_card)) == 1 and n(c.my_1th_card) != n(c.my_2th_card):
        return True
    else:
        return False
Esempio n. 18
0
def Me_Open_str_draw_2_cards(table_cards_list=None):
    """ if Me_str == True: retun False """
    global flop_stage , turn_stage , river_stage ,\
    board_card_1th , board_card_2th , board_card_3th , board_card_4th , board_card_5th , my_1th_card , my_2th_card
    load_variables()

    if table_cards_list == None:
        if flop_stage == True and turn_stage == False:
            table_cards_list = [board_card_1th, board_card_2th, board_card_3th]
        elif turn_stage == True and river_stage == False:
            table_cards_list = [
                board_card_1th, board_card_2th, board_card_3th, board_card_4th
            ]
        elif river_stage == True:
            table_cards_list = [
                board_card_1th, board_card_2th, board_card_3th, board_card_4th,
                board_card_5th
            ]

    if n(my_1th_card) == n(my_2th_card):
        return False
    for i in open_str_draw_2_Cards_list(table_cards_list):
        if n(my_1th_card) in i and n(my_2th_card) in i:
            return True
        if n(my_1th_card) == 14:
            if 1 in i and n(my_2th_card) in i:
                return True
        if n(my_2th_card) == 14:
            if n(my_1th_card) in i and 1 in i:
                return True
    return False
def Me_full_house_Ranking(board_list=None):
    """
    Ranks: 1,2,3,4
    Table_2_pair : 1 ([4,4,10,7,7],10,7) or ([4,10,10,7,7],10,4).  2 ([7,10,10,4,4],10,4).  4 ([4,4,10,7,7],4,10).
    Table_1_pair : depends on 2 same cards Ranking not 3 same cards ranking.
    Table_1_pair : 1 ( [2,3,5,5,6] , 5 , 6 ) .  2 ( [2,3,5,5,6] , 5 , 3 ).  3 ( [2,3,5,5,6] , 5 , 2 )
    """

    if board_list == None:
        board_list = board_cards_list()[:]
    if board_list == []:
        return None

    if Me_full_house(board_list) == True:

        board_list = [n(i) for i in board_list]
        board_list.sort(reverse=True)

        if Table_2_pair(board_list):

            Card = []
            for i in range(len(board_list)):
                if board_list.count(
                        board_list[i]) == 2 and board_list[i] not in Card:
                    Card.append(board_list[i])
            Card.sort(reverse=True)

            if Card[0] not in (n(c.my_1th_card), n(c.my_2th_card)):
                return 4  # very rare
            else:
                if Card[1] not in (n(c.my_1th_card), n(
                        c.my_2th_card)) and Card[1] != min(board_list):
                    return 1
                if (n(c.my_1th_card)) != Card[0]: My_Card = c.my_1th_card
                if (n(c.my_2th_card)) != Card[0]: My_Card = c.my_2th_card
                Card2 = []
                for i in (board_list):
                    if Card[0] == i or i in Card2:
                        continue
                    else:
                        Card2.append(i)
                return Cards_Matching(Card2, My_Card)

        if board_list.count(n(c.my_1th_card)) == 1:
            My_Card = c.my_1th_card
        elif board_list.count(n(c.my_2th_card)) == 1:
            My_Card = c.my_2th_card

        Card = []
        for i in range(len(board_list)):
            if board_list.count(board_list[i]) == 1:
                Card.append(board_list[i])
        Card.sort(reverse=True)

        return Cards_Matching(Card, My_Card)
def Me_pocket_4_of_kinds(board_list=None):

    if board_list == None:
        board_list = board_cards_list()[:]
    if board_list == []:
        return False

    board_list = [n(i) for i in board_list]

    if board_list.count(n(c.my_1th_card)) == 2 and board_list.count(
            n(c.my_2th_card)) == 2 and n(c.my_1th_card) == n(c.my_2th_card):
        return True
    else:
        return False
def Me_pocket_full_house(board_list=None):

    if board_list == None:
        board_list = board_cards_list()[:]
    if board_list == []:
        return False

    board_list = [n(i) for i in board_list]

    if board_list.count( n(c.my_1th_card) ) == 1 and board_list.count( n(c.my_2th_card) ) == 1 and n(c.my_1th_card) == n(c.my_2th_card) \
       and ( Table_1_pair( board_list ) or Table_2_pair( board_list ) or Table_3_of_kinds( board_list ) ):
        return True
    else:
        return False
def Me_full_house(board_list=None):

    if board_list == None:
        board_list = board_cards_list()[:]
    if board_list == []:
        return False

    board_list = [n(i) for i in board_list]

    if ( (board_list.count( n(c.my_1th_card) ) == 2 and 1 <= board_list.count( n(c.my_2th_card) ) <= 2)\
       or (1 <= board_list.count( n(c.my_1th_card) ) <= 2 and board_list.count( n(c.my_2th_card) ) == 2) ) and n(c.my_1th_card) != n(c.my_2th_card) :
        return True
    else:
        return False
def Cards_Matching(board_list, My_Card):

    if board_list == []:
        return None
    board_list = [n(i) for i in board_list]
    My_Card = n(My_Card)

    board_list = list(set(board_list))
    board_list.sort(reverse=True)
    if My_Card in board_list:
        for i in range(len(board_list)):
            if My_Card == board_list[i]:
                return i + 1
    else:
        return None
Esempio n. 24
0
def Me_pocket_3_of_kinds_Ranking(List=None):
    """
    Ranks: 1,2,3,4,5,6
    6: if Table_4_of_kinds : ([4,4,4,4,10],10,10)
    """

    if List == None:
        if c.flop_stage == True and c.turn_stage == False:
            List = [c.board_card_1th, c.board_card_2th, c.board_card_3th]
        elif c.turn_stage == True and c.river_stage == False:
            List = [
                c.board_card_1th, c.board_card_2th, c.board_card_3th,
                c.board_card_4th
            ]
        elif c.river_stage == True:
            List = [
                c.board_card_1th, c.board_card_2th, c.board_card_3th,
                c.board_card_4th, c.board_card_5th
            ]

    if Me_pocket_3_of_kinds(List) == True:

        if Table_4_of_kinds(List) == True:
            return 6
        List = [n(i) for i in List]
        List.sort(reverse=True)

        My_Card = c.my_1th_card
        return Cards_Matching(List, My_Card)
Esempio n. 25
0
def Me_Individual_Ranking(List=None):
    """
    Ranks :1,...,9
    1: ([14,13,5,4,3],12,8).  2: ([14,14,5,4,3],12,8)
    """

    if List == None:
        if c.flop_stage == True and c.turn_stage == False:
            List = [c.board_card_1th, c.board_card_2th, c.board_card_3th]
        elif c.turn_stage == True and c.river_stage == False:
            List = [
                c.board_card_1th, c.board_card_2th, c.board_card_3th,
                c.board_card_4th
            ]
        elif c.river_stage == True:
            List = [
                c.board_card_1th, c.board_card_2th, c.board_card_3th,
                c.board_card_4th, c.board_card_5th
            ]

    if Me_Individual(List) == True:

        List = [n(i) for i in List]
        List.sort(reverse=True)

        My_Card = max(c.my_1th_card, c.my_2th_card)
        rank = 1
        for i in range(14, 1, -1):
            if i == My_Card:
                break
            elif i in List:
                continue
            rank += 1

        return rank
Esempio n. 26
0
def Me_2_pair_Ranking(List=None):
    """
    Best Rank: (1, 2) Example: ([6,2,2,10,8],10,8)
    note: first index is always lower like 1 in (1, 2)
    """

    if List == None:
        if c.flop_stage == True and c.turn_stage == False:
            List = [c.board_card_1th, c.board_card_2th, c.board_card_3th]
        elif c.turn_stage == True and c.river_stage == False:
            List = [
                c.board_card_1th, c.board_card_2th, c.board_card_3th,
                c.board_card_4th
            ]
        elif c.river_stage == True:
            List = [
                c.board_card_1th, c.board_card_2th, c.board_card_3th,
                c.board_card_4th, c.board_card_5th
            ]

    if Me_2_pair(List) == True:

        List = [n(i) for i in List]
        List.sort(reverse=True)

        return (Cards_Matching(List, max(c.my_1th_card, c.my_2th_card)),
                Cards_Matching(List, min(c.my_1th_card, c.my_2th_card)))
def Me_pocket_pair_Ranking(board_list=None):
    """
    Ranks :1,2,3,4,5,6
    1 :([14,14,6,5,4],9,9) or ([14,14,14,5,4],9,9)
    6 :([14,13,9,8,7],4,4)
    """

    if board_list == None:
        board_list = board_cards_list()[:]
    if board_list == []:
        return None

    if Me_pocket_pair(board_list) == True:

        board_list = [n(i) for i in board_list]
        board_list.sort(reverse=True)

        board_list = [i for i in board_list if board_list.count(i) == 1]
        My_Card = c.my_1th_card
        rank = 1
        for i in range(14, 1, -1):
            if i == My_Card:
                break
            elif i in board_list:
                rank += 1

        return rank
def Me_Individual_Ranking(board_list=None):
    """
    Ranks :1,...,9
    1: ([14,13,5,4,3],12,8).  2: ([14,14,5,4,3],12,8)
    """

    if board_list == None:
        board_list = board_cards_list()[:]
    if board_list == []:
        return None

    if Me_Individual(board_list) == True:

        board_list = [n(i) for i in board_list]
        board_list.sort(reverse=True)

        My_Card = max(c.my_1th_card, c.my_2th_card)
        rank = 1
        for i in range(14, 1, -1):
            if i == My_Card:
                break
            elif i in board_list:
                continue
            rank += 1

        return rank
Esempio n. 29
0
def Table_4_same_Cards_List(List=None):
    """ [] or max one index"""

    if List == None:
        if c.flop_stage == True and c.turn_stage == False:
            List = [c.board_card_1th, c.board_card_2th, c.board_card_3th]
        elif c.turn_stage == True and c.river_stage == False:
            List = [
                c.board_card_1th, c.board_card_2th, c.board_card_3th,
                c.board_card_4th
            ]
        elif c.river_stage == True:
            List = [
                c.board_card_1th, c.board_card_2th, c.board_card_3th,
                c.board_card_4th, c.board_card_5th
            ]

    List = [n(i) for i in List]

    Table_4_same_Cards = []
    for i in List:
        if List.count(i) == 4 and i not in Table_4_same_Cards:
            Table_4_same_Cards.append(i)
    Table_4_same_Cards.sort(reverse=True)
    return Table_4_same_Cards
def Me_pocket_3_of_kinds(board_list=None):

    if board_list == None:
        board_list = board_cards_list()[:]
    if board_list == []:
        return False

    board_list = [n(i) for i in board_list]

    if board_list.count(n(c.my_1th_card)) == 1 and board_list.count(
            n(c.my_2th_card)) == 1 and n(c.my_1th_card) == n(
                c.my_2th_card) and (Table_Individual(board_list)
                                    or Table_4_of_kinds(board_list)):
        return True
    else:
        return False