自用組幀工具

2021-06-25 07:25:02 字數 3666 閱讀 6116

#coding:utf-8

button = 'button' # 莊稼?????

l_blind = 'little_blind' # 小盲注

b_blind = 'big_blind' # 小盲注

seat = 'seat'

hold = 'hold'   # 手牌

ask  = 'ask'    # ?????

first= 'first'  # 第一次發三張牌 ?????

turn = 'turn'   # 轉牌

river= 'river'  # 河牌

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), # 共2人,我是第0位,0位表示莊稼

(hold, [(hei, 'a'), (hei, 'k')]),

(act, [0,]), # -1=放棄, 0=讓(或跟), n=加n注

(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 = ' : \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 '''\ 

\ '''.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 '''\ 

\ '''.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 '''\ 

\ '''.format(turn,

body_info[0][0], body_info[0][1],

)def analyse_river(one_info):

body_info = one_info[1]

return '''\ 

\ '''.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 500 call 

total: ***x 

\ask 

'''core = ''

for i,itm in enumerate(one_info[1]):

if 0 == itm:

extra_info = 'check'

pay = little_blind_money # ????

elif -1 == itm: # ???? 有人棄牌會引發組裝錯誤

extra_info = 'fold'

pay = 0

else:

extra_info = 'raise'

pay = little_blind_money*itm

pid = get_pid(i)

cur_bet = 500 # ???? 需要動態獲取

cur_money = 8000

this_line = ': \n'.format(

pid, cur_bet, cur_money, pay, extra_info)

core += this_line

total_pot = 1000 # ?????

rtn = '''

\ total:  

\ '''.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)

自用組幀工具

coding utf 8 button button 莊稼?l blind little blind 小盲注 b blind big blind 小盲注 seat seat hold hold 手牌 ask ask first first 第一次發三張牌 turn turn 轉牌 river riv...

幀分析工具

對於音遊來說,一場對局如果有卡頓的話,可能會直接影響到比賽成績,本來可以拿第一名的,結果因為卡頓掉到了第二名,甚至更低名次。卡頓對於音遊,moba等很多態別來講,都是很影響體驗的,甚至是很致命的,因為這直接關乎留存率。其中gc是最常見 最普通的卡頓,也是比較難搞的。由於unity mono目前還是使...

tcpdump截幀工具使用

tcpdump是linux下功能強大的截幀工具,相當於windows下的wireshark一下,只是操作方式是命令列的,需要熟悉linux命令列操作。下面列出了tcpdump的常用引數 tcpdump表示式用來設定哪些資料報被列印到命令列,如果不設定過濾表示式網路上所有 獲的包都會被列印,否則,只有...