-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhole_cards_level.py
73 lines (71 loc) · 4.58 KB
/
hole_cards_level.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import re
level = {1: [r"14,[1-4],14,[1-4]"],
2: [r"13,[1-4],13,[1-4]"],
3: [r"12,[1-4],12,[1-4]"],
4: [r"11,[1-4],11,[1-4]"],
5: [r"13,([1-4]),14,\1"],
6: [r"12,([1-4]),14,\1"],
7: [r"10,[1-4],10,[1-4]"],
8: [r"13,[1-4],14,[1-4]"],
9: [r"11,([1-4]),14,\1"],
10: [r"12,([1-4]),13,\1"],
11: [r"9,[1-4],9,[1-4]"],
12: [r"10,([1-4]),14,\1"],
13: [r"12,[1-4],14,[1-4]"],
14: [r"11,([1-4]),13,\1"],
15: [r"8,[1-4],8,[1-4]"],
16: [r"11,([1-4]),12,\1"],
17: [r"10,([1-4]),13,\1"],
18: [r"9,([1-4]),14,\1", r"11,[1-4],14,[1-4]"],
19: [r"10,([1-4]),12,\1"],
20: [r"12,[1-4],13,[1-4]", r"7,[1-4],7,[1-4]"],
21: [r"10,([1-4]),11,\1"],
22: [r"8,([1-4]),14,\1"],
23: [r"9,([1-4]),13,\1"],
24: [r"10,[1-4],14,[1-4]", r"5,([1-4]),14,\1", r"7,([1-4]),14,\1", r"11,[1-4],13,[1-4]"],
25: [r"6,[1-4],6,[1-4]"],
26: [r"9,([1-4]),10,\1", r"4,([1-4]),14,\1", r"9,([1-4]),12,\1"],
27: [r"9,([1-4]),11,\1"],
28: [r"11,[1-4],12,[1-4]", r"6,([1-4]),14,\1"],
29: [r"5,[1-4],5,[1-4]", r"3,([1-4]),14,\1"],
30: [r"8,([1-4]),13,\1", r"10,[1-4],13,[1-4]"],
31: [r"8,([1-4]),9,\1", r"8,([1-4]),10,\1", r"7,([1-4]),13,\1", r"2,([1-4]),14,\1"],
32: [r"7,([1-4]),8,\1", r"10,[1-4],12,[1-4]", r"8,([1-4]),12,\1"],
33: [r"4,[1-4],4,[1-4]", r"9,[1-4],14,[1-4]", r"8,([1-4]),11,\1", r"6,([1-4]),7,\1", r"10,[1-4],11,[1-4]"],
34: [r"7,([1-4]),9,\1", r"6,([1-4]),13,\1"],
35: [r"5,([1-4]),13,\1", r"4,([1-4]),13,\1", r"7,([1-4]),10,\1"],
36: [r"7,([1-4]),12,\1"],
37: [r"9,[1-4],13,[1-4]", r"5,([1-4]),6,\1", r"9,[1-4],10,[1-4]", r"6,([1-4]),8,\1", r"8,[1-4],14,[1-4]",
r"7,([1-4]),11,\1", r"3,[1-4],3,[1-4]"],
38: [r"4,([1-4]),5,\1", r"6,([1-4]),12,\1", r"3,([1-4]),13,\1", r"9,[1-4],12,[1-4]"],
39: [r"5,([1-4]),7,\1", r"2,[1-4],2,[1-4]", r"9,[1-4],11,[1-4]", r"4,([1-4]),6,\1", r"5,([1-4]),12,\1",
r"2,([1-4]),13,\1", r"6,([1-4]),9,\1"],
40: [r"3,([1-4]),12,\1", r"8,[1-4],11,[1-4]", r"8,[1-4],9,[1-4]", r"8,[1-4],10,[1-4]", r"7,[1-4],9,[1-4]",
r"7,[1-4],14,[1-4]", r"7,[1-4],10,[1-4]", r"4,([1-4]),12,\1"],
41: [r"8,[1-4],12,[1-4]", r"5,([1-4]),11,\1", r"6,[1-4],10,[1-4]", r"5,[1-4],7,[1-4]", r"4,([1-4]),11,\1",
r"4,([1-4]),7,\1", r"8,[1-4],13,[1-4]", r"6,[1-4],8,[1-4]", r"3,([1-4]),5,\1", r"7,[1-4],13,[1-4]",
r"3,([1-4]),6,\1", r"6,([1-4]),11,\1", r"5,[1-4],8,[1-4]", r"6,([1-4]),10,\1", r"6,[1-4],7,[1-4]"],
42: [r"6,[1-4],14,[1-4]", r"2,[1-4],10,[1-4]", r"5,([1-4]),9,\1", r"4,[1-4],8,[1-4]", r"2,[1-4],6,[1-4]",
r"5,([1-4]),10,\1", r"5,[1-4],9,[1-4]", r"5,[1-4],14,[1-4]", r"7,[1-4],12,[1-4]", r"5,[1-4],10,[1-4]",
r"7,[1-4],8,[1-4]", r"3,[1-4],8,[1-4]", r"5,[1-4],6,[1-4]", r"2,([1-4]),12,\1", r"4,[1-4],9,[1-4]",
r"4,[1-4],7,[1-4]", r"4,[1-4],5,[1-4]", r"4,[1-4],14,[1-4]", r"4,[1-4],10,[1-4]", r"2,[1-4],8,[1-4]",
r"4,[1-4],6,[1-4]", r"2,[1-4],4,[1-4]", r"7,[1-4],11,[1-4]", r"3,[1-4],9,[1-4]", r"5,([1-4]),8,\1",
r"3,[1-4],7,[1-4]", r"3,[1-4],5,[1-4]", r"3,[1-4],10,[1-4]", r"3,[1-4],6,[1-4]", r"6,[1-4],13,[1-4]",
r"6,[1-4],11,[1-4]", r"6,[1-4],9,[1-4]", r"2,[1-4],9,[1-4]", r"2,[1-4],7,[1-4]", r"2,[1-4],5,[1-4]"],
43: [r"4,[1-4],12,[1-4]", r"5,[1-4],13,[1-4]", r"5,[1-4],11,[1-4]", r"3,([1-4]),4,\1", r"3,[1-4],12,[1-4]",
r"3,[1-4],4,[1-4]", r"4,[1-4],13,[1-4]", r"4,[1-4],11,[1-4]", r"4,([1-4]),10,\1", r"6,[1-4],12,[1-4]",
r"2,[1-4],12,[1-4]", r"3,([1-4]),11,\1", r"3,[1-4],11,[1-4]", r"3,([1-4]),10,\1", r"3,[1-4],14,[1-4]",
r"5,[1-4],12,[1-4]", r"2,[1-4],11,[1-4]", r"4,([1-4]),8,\1"],
44: [r"2,([1-4]),8,\1", r"2,([1-4]),4,\1", r"3,([1-4]),9,\1", r"3,([1-4]),7,\1", r"3,[1-4],13,[1-4]",
r"2,([1-4]),11,\1", r"2,([1-4]),9,\1", r"2,([1-4]),5,\1", r"2,[1-4],13,[1-4]", r"2,([1-4]),10,\1",
r"2,([1-4]),6,\1", r"2,[1-4],3,[1-4]"],
45: [r"2,[1-4],14,[1-4]", r"3,([1-4]),8,\1", r"4,([1-4]),9,\1", r"2,([1-4]),7,\1", r"2,([1-4]),3,\1"]
}
def get_hole_card_level(hand_card0, hand_card1):
if hand_card0[0] > hand_card1[0]:
hand_card0, hand_card1 = hand_card1, hand_card0
string = "%d,%d,%d,%d" % (hand_card0[0], hand_card0[1], hand_card1[0], hand_card1[1])
for x in level.keys():
for y in level[x]:
if re.findall(y, string):
return x