#coding: Utf-8
button = ' button ' # crop??
?
?
?
L_blind = ' little_blind ' # small Blind
B_blind = ' big_blind ' # small Blind
SEAT = ' SEAT '
hold = "Hold" # Hand
Ask = ' Ask ' #?
?
?
??
First= ' first ' # three cards?????
TURN = ' TURN ' # Turn card
River= ' River ' # Rivers Card
act = ' act '
# ?
???
HEI = ' HEI '
Hong = ' Hong '
Mei = ' Mei '
FANG = ' FANG '
Little_blind_money = 500
Start_money = 8000
Start_bet = 2000
Input_info = [
(SEAT, 2, 0), # A total of 2 people, I am the No. 0 place, 0 is the crop
(Hold, [(HEI, ' A '), (HEI, ' K ')]),
(ACT, [0,]), # -1= give up, 0 = let (or follow), n= plus n Note
(First, [(HEI, ' Q '), (HEI, ' J '), (HEI, ' 10 ')]),
(ACT, [0, 1]),
(TURN, [(HONG, ' 2 '),]),
(ACT, [0, 1]),
(River, [(FANG, ' 3 '),]),
(ACT, [0, 1]),
]
def analyse_seat (One_info):
person_cnt = one_info[1]
My_seat = one_info[2]
Core = '
For I in Range (person_cnt):
If my_seat = = I:
PID = 3001
Else
PID = 9001+i
If i = = 0:
Extra_info = BUTTON
elif i = = 1:
Extra_info = L_blind
elif i = = 2:
Extra_info = B_blind
Else
Extra_info = ' '
This_line = ' {0} {1}: {2} {3} \ n '. Format (Extra_info, PID, Start_bet, Start_money) #??????
Core + = This_line
return seat+ '/\ n ' + core + '/' +seat + ' \ n '
def analyse_hold (One_info):
‘‘‘
Hold\
HEI 10
MEI 9
\hold
‘‘‘
Body_info = one_info[1]
Return ' {0}\
{1} {2}
{3} {4}
\{0} ". Format (Hold,
Body_info[0][0], body_info[0][1],
Body_info[1][0], body_info[1][1],
)
def analyse_first (One_info):
Body_info = one_info[1]
Return ' {0}\
{1} {2}
{3} {4}
{5} {6}
\{0} ". Format (First,
Body_info[0][0], body_info[0][1],
Body_info[1][0], body_info[1][1],
Body_info[2][0], body_info[2][1],
)
def analyse_turn (One_info):
Body_info = one_info[1]
Return ' {0}\
{1} {2}
\{0} ". Format (TURN,
Body_info[0][0], body_info[0][1],
)
def analyse_river (One_info):
Body_info = one_info[1]
Return ' {0}\
{1} {2}
\{0} ". Format (River,
Body_info[0][0], body_info[0][1],
)
# ?????
def get_pid (i):
Return 9001 + I
def analyse_act (One_info):
‘‘‘
Ask\
9001:0 8000
Total:xxxx
\ask
‘‘‘
Core = '
For I,ITM in enumerate (one_info[1]):
If 0 = = itm:
Extra_info = ' Check '
pay = Little_blind_money #????
Elif-1 = = itm: #???? Someone folding will cause assembly errors
Extra_info = ' fold '
Pay = 0
Else
Extra_info = ' Raise '
Pay = Little_blind_money*itm
PID = Get_pid (i)
Cur_bet = #????
Dynamic Access Required
Cur_money = 8000
This_line = ' {0}: {1} {2} {3} {4} \ n '. Format (
PID, Cur_bet, Cur_money, pay, Extra_info)
Core + = This_line
Total_pot = 1000 #?
?
???
RTN = "'
{0}\
{1}total: {2}
\{0}
". Format (ASK, Core, total_pot) #??
???
??
?
Return RTN
def analyse_one (One_info):
Type = One_info[0]
if type = = SEAT:
RTN = Analyse_seat (one_info)
elif type = = hold:
RTN = Analyse_hold (one_info)
Elif type = = First:
RTN = Analyse_first (one_info)
elif type = = TURN:
RTN = Analyse_turn (one_info)
elif type = = River:
RTN = Analyse_river (one_info)
elif type = = ACT:
RTN = Analyse_act (one_info)
Else
print ' type error '
Return RTN
def analyse (All_info):
RTN = ' '
For ITM in All_info:
Rtn + = Analyse_one (ITM)
Return RTN
Print Analyse (Input_info)
Personal Framing Tool