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 Flop1_Deside , Turn1_Deside , River1_Deside ,\ Card_1th , Card_2th , Card_3th , Card_4th , Card_5th , My_1th_Card , My_2th_Card globalization() if table_cards_list == None : if Flop1_Deside == True and Turn1_Deside == False : table_cards_list = [ Card_1th , Card_2th , Card_3th ] elif Turn1_Deside == True and River1_Deside == False : table_cards_list = [ Card_1th , Card_2th , Card_3th , Card_4th ] elif River1_Deside == True : table_cards_list = [ Card_1th , Card_2th , Card_3th , Card_4th , 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
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) """ global Flop1_Deside , Turn1_Deside , River1_Deside ,\ Card_1th , Card_2th , Card_3th , Card_4th , Card_5th , My_1th_Card , My_2th_Card globalization() if List == None: if Flop1_Deside == True and Turn1_Deside == False: List = [Card_1th, Card_2th, Card_3th] elif Turn1_Deside == True and River1_Deside == False: List = [Card_1th, Card_2th, Card_3th, Card_4th] elif River1_Deside == True: List = [Card_1th, Card_2th, Card_3th, Card_4th, 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(My_1th_Card)) == 1: My_Card = My_1th_Card My_Kicker = My_2th_Card elif List.count(n(My_2th_Card)) == 1: My_Card = My_2th_Card My_Kicker = My_1th_Card return (Cards_Matching(List, My_Card), n(My_Kicker))
def hand4(): """ 88,77,...,22 """ global My_1th_Card, My_2th_Card globalization() 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
def hand3(): """ 1010,99 """ global My_1th_Card, My_2th_Card globalization() 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
def hand2(): """ QQ,JJ """ global My_1th_Card, My_2th_Card globalization() 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
def hand1(): """ AA,KK """ global My_1th_Card, My_2th_Card globalization() 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
def Me_full_house_Ranking(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 ) """ global Flop1_Deside , Turn1_Deside , River1_Deside ,\ Card_1th , Card_2th , Card_3th , Card_4th , Card_5th , My_1th_Card , My_2th_Card globalization() if List == None: if Flop1_Deside == True and Turn1_Deside == False: List = [Card_1th, Card_2th, Card_3th] elif Turn1_Deside == True and River1_Deside == False: List = [Card_1th, Card_2th, Card_3th, Card_4th] elif River1_Deside == True: List = [Card_1th, Card_2th, Card_3th, Card_4th, Card_5th] if Me_full_house(List) == True: List = [n(i) for i in List] List.sort(reverse=True) if Table_2_pair(List): Card = [] for i in range(len(List)): if List.count(List[i]) == 2 and List[i] not in Card: Card.append(List[i]) Card.sort(reverse=True) if Card[0] not in (n(My_1th_Card), n(My_2th_Card)): return 4 # very rare else: if Card[1] not in (n(My_1th_Card), n(My_2th_Card)) and Card[1] != min(List): return 1 if (n(My_1th_Card)) != Card[0]: My_Card = My_1th_Card if (n(My_2th_Card)) != Card[0]: My_Card = My_2th_Card Card2 = [] for i in (List): if Card[0] == i or i in Card2: continue else: Card2.append(i) return Cards_Matching(Card2, My_Card) if List.count(n(My_1th_Card)) == 1: My_Card = My_1th_Card elif List.count(n(My_2th_Card)) == 1: My_Card = My_2th_Card Card = [] for i in range(len(List)): if List.count(List[i]) == 1: Card.append(List[i]) Card.sort(reverse=True) return Cards_Matching(Card, My_Card)
def hand8(): """ AK,...,1010,...22,...,(65 rang) Blind position call 2 blind raise, otherwise fold that """ global My_1th_Card, My_2th_Card globalization() 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_Open_str_draw_2_cards_Ranking( table_cards_list = None ) : """ Rank 1,2,3 & None """ global Flop1_Deside , Turn1_Deside , River1_Deside ,\ Card_1th , Card_2th , Card_3th , Card_4th , Card_5th , My_1th_Card , My_2th_Card globalization() if table_cards_list == None : if Flop1_Deside == True and Turn1_Deside == False : table_cards_list = [ Card_1th , Card_2th , Card_3th ] elif Turn1_Deside == True and River1_Deside == False : table_cards_list = [ Card_1th , Card_2th , Card_3th , Card_4th ] elif River1_Deside == True : table_cards_list = [ Card_1th , Card_2th , Card_3th , Card_4th , Card_5th ] if n(My_1th_Card) == n(My_2th_Card): return None rank = 0 for i in open_str_draw_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
def hand7(): """ 72,73,...,96,107 (gheir rang) Fold small blind position (otherwise Small always call Blind) """ global My_1th_Card, My_2th_Card globalization() 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_Open_str_draw_2_cards( table_cards_list = None ) : """ if Me_str == True: retun False """ global Flop1_Deside , Turn1_Deside , River1_Deside ,\ Card_1th , Card_2th , Card_3th , Card_4th , Card_5th , My_1th_Card , My_2th_Card globalization() if table_cards_list == None : if Flop1_Deside == True and Turn1_Deside == False : table_cards_list = [ Card_1th , Card_2th , Card_3th ] elif Turn1_Deside == True and River1_Deside == False : table_cards_list = [ Card_1th , Card_2th , Card_3th , Card_4th ] elif River1_Deside == True : table_cards_list = [ Card_1th , Card_2th , Card_3th , Card_4th , 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_pocket_pair_Ranking(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) """ global Flop1_Deside , Turn1_Deside , River1_Deside ,\ Card_1th , Card_2th , Card_3th , Card_4th , Card_5th , My_1th_Card , My_2th_Card globalization() if List == None: if Flop1_Deside == True and Turn1_Deside == False: List = [Card_1th, Card_2th, Card_3th] elif Turn1_Deside == True and River1_Deside == False: List = [Card_1th, Card_2th, Card_3th, Card_4th] elif River1_Deside == True: List = [Card_1th, Card_2th, Card_3th, Card_4th, Card_5th] if Me_pocket_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] My_Card = My_1th_Card rank = 1 for i in range(14, 1, -1): if i == My_Card: break elif i in List: rank += 1 return rank
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) """ global Flop1_Deside , Turn1_Deside , River1_Deside ,\ Card_1th , Card_2th , Card_3th , Card_4th , Card_5th , My_1th_Card , My_2th_Card globalization() if List == None: if Flop1_Deside == True and Turn1_Deside == False: List = [Card_1th, Card_2th, Card_3th] elif Turn1_Deside == True and River1_Deside == False: List = [Card_1th, Card_2th, Card_3th, Card_4th] elif River1_Deside == True: List = [Card_1th, Card_2th, Card_3th, Card_4th, Card_5th] if Me_Individual(List) == True: List = [n(i) for i in List] List.sort(reverse=True) My_Card = max(My_1th_Card, 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
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) """ global Flop1_Deside , Turn1_Deside , River1_Deside ,\ Card_1th , Card_2th , Card_3th , Card_4th , Card_5th , My_1th_Card , My_2th_Card globalization() if List == None: if Flop1_Deside == True and Turn1_Deside == False: List = [Card_1th, Card_2th, Card_3th] elif Turn1_Deside == True and River1_Deside == False: List = [Card_1th, Card_2th, Card_3th, Card_4th] elif River1_Deside == True: List = [Card_1th, Card_2th, Card_3th, Card_4th, 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 = My_1th_Card return Cards_Matching(List, My_Card)
def Cards_Matching(List, My_Card): """ Lists var act like global in python functions. so List should be written like this to avoid manipulation in Lists var to furthermore usage in the other functions: Cards_Matching( [ Card_1th, Card_2th, Card_3th, Card_4th ] , My_Card ) """ List = [n(i) for i in List] My_Card = n(My_Card) List = list(set(List)) List.sort(reverse=True) if My_Card in List: for i in range(len(List)): if My_Card == List[i]: return i + 1 else: return None
def Me_4_of_kinds(List=None): global Flop1_Deside , Turn1_Deside , River1_Deside ,\ Card_1th , Card_2th , Card_3th , Card_4th , Card_5th , My_1th_Card , My_2th_Card globalization() if List == None: if Flop1_Deside == True and Turn1_Deside == False: List = [Card_1th, Card_2th, Card_3th] elif Turn1_Deside == True and River1_Deside == False: List = [Card_1th, Card_2th, Card_3th, Card_4th] elif River1_Deside == True: List = [Card_1th, Card_2th, Card_3th, Card_4th, Card_5th] List = [n(i) for i in List] if List.count(n(My_1th_Card)) == 3 or List.count(n(My_2th_Card)) == 3: return True else: return False
def hand6(): """ KJ,QJ,,...,A2,...,(108,98 rang),109 1 Blind call """ global My_1th_Card, My_2th_Card globalization() if n(My_1th_Card) != n(My_2th_Card): if hand5() != True: if 14 in [ n( My_1th_Card ) , n( My_2th_Card ) ] \ or ( n( My_1th_Card ) >= 8 and n( My_2th_Card ) >= 8 and s( My_1th_Card ) == s( My_2th_Card ) ) \ or ( n( My_1th_Card ) >= 9 and n( My_2th_Card ) >= 9 ) : #shout("hand6 is True") return True else: return None
def Me_pocket_full_house(List=None): global Flop1_Deside , Turn1_Deside , River1_Deside ,\ Card_1th , Card_2th , Card_3th , Card_4th , Card_5th , My_1th_Card , My_2th_Card globalization() if List == None: if Flop1_Deside == True and Turn1_Deside == False: List = [Card_1th, Card_2th, Card_3th] elif Turn1_Deside == True and River1_Deside == False: List = [Card_1th, Card_2th, Card_3th, Card_4th] elif River1_Deside == True: List = [Card_1th, Card_2th, Card_3th, Card_4th, Card_5th] List = [n(i) for i in List] if List.count( n(My_1th_Card) ) == 1 and List.count( n(My_2th_Card) ) == 1 and n(My_1th_Card) == n(My_2th_Card) \ and ( Table_1_pair( List ) or Table_2_pair( List ) or Table_3_of_kinds( List ) ): return True else: return False
def Me_full_house(List=None): global Flop1_Deside , Turn1_Deside , River1_Deside ,\ Card_1th , Card_2th , Card_3th , Card_4th , Card_5th , My_1th_Card , My_2th_Card globalization() if List == None: if Flop1_Deside == True and Turn1_Deside == False: List = [Card_1th, Card_2th, Card_3th] elif Turn1_Deside == True and River1_Deside == False: List = [Card_1th, Card_2th, Card_3th, Card_4th] elif River1_Deside == True: List = [Card_1th, Card_2th, Card_3th, Card_4th, Card_5th] List = [n(i) for i in List] if ( (List.count( n(My_1th_Card) ) == 2 and 1 <= List.count( n(My_2th_Card) ) <= 2)\ or (1 <= List.count( n(My_1th_Card) ) <= 2 and List.count( n(My_2th_Card) ) == 2) ) and n(My_1th_Card) != n(My_2th_Card) : return True else: return False
def cards_ranking( My_Card, List=None ): # screenshot va be cheat sheet e pair functions ezafe shavad """ Lists var act like global in python functions. so List should be written like this to avoid manipulation in Lists var to furthermore usage in the other functions: Cards_Ranking( My_Card , [ Card_1th, Card_2th, Card_3th, Card_4th ] ) """ """ 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]) 2: (10, [12,10,7]). 4: (5, [12,10,7]). 6: (3, [12,11,7,6,5]) """ global Flop1_Deside , Turn1_Deside , River1_Deside ,\ Card_1th , Card_2th , Card_3th , Card_4th , Card_5th globalization() if List == None: if Flop1_Deside == True and Turn1_Deside == False: List = [Card_1th, Card_2th, Card_3th] elif Turn1_Deside == True and River1_Deside == False: List = [Card_1th, Card_2th, Card_3th, Card_4th] elif River1_Deside == True: List = [Card_1th, Card_2th, Card_3th, Card_4th, Card_5th] for i in range(len(List)): List[i] = n(List[i]) My_Card = n(My_Card) List = list(set(List)) List.sort(reverse=True) Cards_Ranking = 1 for i in range(len(List)): if My_Card >= List[i]: return Cards_Ranking else: Cards_Ranking = Cards_Ranking + 1 return Cards_Ranking
def Me_str_1_cards( table_cards_list = None ) : """ if Me_str_2_cards == True : return False """ global Flop1_Deside , Turn1_Deside , River1_Deside ,\ Card_1th , Card_2th , Card_3th , Card_4th , Card_5th , My_1th_Card , My_2th_Card globalization() if table_cards_list == None : if Flop1_Deside == True and Turn1_Deside == False : table_cards_list = [ Card_1th , Card_2th , Card_3th ] elif Turn1_Deside == True and River1_Deside == False : table_cards_list = [ Card_1th , Card_2th , Card_3th , Card_4th ] elif River1_Deside == True : table_cards_list = [ Card_1th , Card_2th , Card_3th , Card_4th , Card_5th ] if Me_str_2_cards( table_cards_list ) == True : return False for i in str_1_Cards_list( table_cards_list ) : if n(My_1th_Card) == i or n(My_2th_Card) == i : return True if n(My_1th_Card) == 14 : if 1 == i or n(My_2th_Card) == i : return True if n(My_2th_Card) == 14 : if n(My_1th_Card) == i or 1 == i : return True return False
def Me_str_1_cards_Ranking( table_cards_list = None ) : """ Rank 1,2 & None None if Me_str_2_cards == True or Me_str == False 1 ( [7,8,9,11] , 10, 2 ) or ([7, 8, 9, 11], 10, 6). 2 ( [7,8,9,10] , 6, 2 ) """ global Flop1_Deside , Turn1_Deside , River1_Deside ,\ Card_1th , Card_2th , Card_3th , Card_4th , Card_5th , My_1th_Card , My_2th_Card globalization() if table_cards_list == None : if Flop1_Deside == True and Turn1_Deside == False : table_cards_list = [ Card_1th , Card_2th , Card_3th ] elif Turn1_Deside == True and River1_Deside == False : table_cards_list = [ Card_1th , Card_2th , Card_3th , Card_4th ] elif River1_Deside == True : table_cards_list = [ Card_1th , Card_2th , Card_3th , Card_4th , Card_5th ] if Me_str_2_cards( table_cards_list ) == True : return None rank = 0 for i in str_1_Cards_list( table_cards_list ) : rank += 1 if n(My_1th_Card) == i or n(My_2th_Card) == i : return rank if n(My_1th_Card) == 14 : if 1 == i or n(My_2th_Card) == i : return rank if n(My_2th_Card) == 14 : if n(My_1th_Card) == i or 1 == i : return rank
def hand5(): """ A10,...,KQ 3 Blind raise """ global My_1th_Card, My_2th_Card globalization() if n(My_1th_Card) != n(My_2th_Card): if ( 12 <= n( My_1th_Card ) <= 13 and 12 <= n( My_2th_Card ) <= 13 ) \ or ( 14 in [ n( My_1th_Card ) , n( My_2th_Card ) ] and n( My_1th_Card ) >= 10 and n( My_2th_Card ) >= 10 ) : #shout("hand5 is True") return True else: return None
def Me_3_of_kinds_Ranking(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. """ global Flop1_Deside , Turn1_Deside , River1_Deside ,\ Card_1th , Card_2th , Card_3th , Card_4th , Card_5th , My_1th_Card , My_2th_Card globalization() if List == None: if Flop1_Deside == True and Turn1_Deside == False: List = [Card_1th, Card_2th, Card_3th] elif Turn1_Deside == True and River1_Deside == False: List = [Card_1th, Card_2th, Card_3th, Card_4th] elif River1_Deside == True: List = [Card_1th, Card_2th, Card_3th, Card_4th, Card_5th] if Me_3_of_kinds(List) == True: List = [n(i) for i in List] List.sort(reverse=True) if List.count(n(My_1th_Card)) == 2: My_Card = My_1th_Card My_Kicker = My_2th_Card elif List.count(n(My_2th_Card)) == 2: My_Card = My_2th_Card My_Kicker = My_2th_Card Card = [] for i in range(len(List)): if List.count(List[i]) == 2 and List[i] not in Card: Card.append(List[i]) Card.sort(reverse=True) return (Cards_Matching(Card, My_Card), n(My_Kicker))
def Me_Flush_by_5_table_cards(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 """ global Flop1_Deside , Turn1_Deside , River1_Deside ,\ Card_1th , Card_2th , Card_3th , Card_4th , Card_5th , My_1th_Card , My_2th_Card globalization() if List == None: if Flop1_Deside == True and Turn1_Deside == False: List = [Card_1th, Card_2th, Card_3th] elif Turn1_Deside == True and River1_Deside == False: List = [Card_1th, Card_2th, Card_3th, Card_4th] elif River1_Deside == True: List = [Card_1th, Card_2th, Card_3th, Card_4th, Card_5th] sign1 = 0 sign2 = 0 for i in List: if s(My_1th_Card) == s(i): sign1 += 1 if s(My_2th_Card) == s(i): sign2 += 1 if sign1 == 5 and sign2 == 5: My_highest = max(n(My_1th_Card), n(My_2th_Card)) elif sign1 == 5: My_highest = n(My_1th_Card) elif sign2 == 5: My_highest = n(My_2th_Card) sign_List = [] for i in List: sign_List.append(n(i)) if (sign1 == 5 or sign2 == 5) and My_highest > min(sign_List): return True return False
def Me_pocket_full_house_Ranking(List=None): """ Ranks: 1,2,3 Table_1_pair: 1 ([2,5,5,7,9], 7,7). 2 ([2,5,5,7,9], 2,2). Table_2_pair: 1 ([2,2,5,5,7], 7,7). 2 ([2,2,5,7,7], 5,5). 3 ([2,5,5,7,7], 2,2). Table_3_of_kinds: 3 ([5,5,5,7,8], 8,8). """ global Flop1_Deside , Turn1_Deside , River1_Deside ,\ Card_1th , Card_2th , Card_3th , Card_4th , Card_5th , My_1th_Card , My_2th_Card globalization() if List == None: if Flop1_Deside == True and Turn1_Deside == False: List = [Card_1th, Card_2th, Card_3th] elif Turn1_Deside == True and River1_Deside == False: List = [Card_1th, Card_2th, Card_3th, Card_4th] elif River1_Deside == True: List = [Card_1th, Card_2th, Card_3th, Card_4th, Card_5th] if Me_pocket_full_house(List) == True: List = [n(i) for i in List] List.sort(reverse=True) if Table_1_pair(List) == True: for i in range(len(List)): if List.count(List[i]) == 2: Card = List[i] break if Card < My_1th_Card: return 1 elif Card > My_1th_Card: return 2 elif Table_2_pair(List) == True: Card = [] for i in range(len(List)): if List.count(List[i]) == 2 and List[i] not in Card: Card.append(List[i]) if max(Card) < My_1th_Card: return 1 elif min(Card) < My_1th_Card < max(Card): return 2 elif min(Card) > My_1th_Card: return 3 elif Table_3_of_kinds(List) == True: return 3
def Table_Individual_Cards_List(List=None): """ [7,7,5,10] returns [10, 5]""" global Flop1_Deside , Turn1_Deside , River1_Deside ,\ Card_1th , Card_2th , Card_3th , Card_4th , Card_5th globalization() if List == None: if Flop1_Deside == True and Turn1_Deside == False: List = [Card_1th, Card_2th, Card_3th] elif Turn1_Deside == True and River1_Deside == False: List = [Card_1th, Card_2th, Card_3th, Card_4th] elif River1_Deside == True: List = [Card_1th, Card_2th, Card_3th, Card_4th, Card_5th] List = [n(i) for i in List] Individual_Cards = [i for i in List if List.count(i) == 1] Individual_Cards.sort(reverse=True) return Individual_Cards
def Table_3_same_Cards_List(List=None): """ [] or max one index""" global Flop1_Deside , Turn1_Deside , River1_Deside ,\ Card_1th , Card_2th , Card_3th , Card_4th , Card_5th globalization() if List == None: if Flop1_Deside == True and Turn1_Deside == False: List = [Card_1th, Card_2th, Card_3th] elif Turn1_Deside == True and River1_Deside == False: List = [Card_1th, Card_2th, Card_3th, Card_4th] elif River1_Deside == True: List = [Card_1th, Card_2th, Card_3th, Card_4th, Card_5th] List = [n(i) for i in List] Table_3_same_Cards = [] for i in List: if List.count(i) == 3 and i not in Table_3_same_Cards: Table_3_same_Cards.append(i) Table_3_same_Cards.sort(reverse=True) return Table_3_same_Cards
def open_str_draw_1_Cards_list( List ) : """ Lists var act like global in python functions. so List should be written like this to avoid manipulation in Lists var to furthermore usage in the other functions: str_2_Cards_list( [ Card_1th, Card_2th, Card_3th, Card_4th ] ) """ for i in range( len(List) ) : List[i] = n( List[i] ) open_str_draw_1_Cards_list = [] for i in range(1,15): Loop_List = [] for cards in List: Loop_List.append(cards) if 14 in Loop_List : Loop_List.append(1) if i in Loop_List : continue Loop_List.append(i) if len(List) == 3 : if str_length( Loop_List ) == 4 and min(Loop_List) != 1 and max(Loop_List) != 14 : open_str_draw_1_Cards_list.append(i) if len(List) == 4 : if str_length( Loop_List ) == 4 : while 14 in Loop_List : Loop_List.remove(14) while 1 in Loop_List : Loop_List.remove(1) if str_length( Loop_List ) == 4 \ and str_length( List ) != 4 : open_str_draw_1_Cards_list.append(i) open_str_draw_1_Cards_list.sort(reverse=True) return open_str_draw_1_Cards_list
def Table_Individual(List=None): global Flop1_Deside , Turn1_Deside , River1_Deside ,\ Card_1th , Card_2th , Card_3th , Card_4th , Card_5th globalization() if List == None: if Flop1_Deside == True and Turn1_Deside == False: List = [Card_1th, Card_2th, Card_3th] elif Turn1_Deside == True and River1_Deside == False: List = [Card_1th, Card_2th, Card_3th, Card_4th] elif River1_Deside == True: List = [Card_1th, Card_2th, Card_3th, Card_4th, Card_5th] List = [n(i) for i in List] pair_list = [] for i in range(2, 15): if List.count(i) >= 2: pair_list.append(List.count(i)) if len(pair_list) == 0: return True else: return False