アットウィキロゴ

w22お99

import sho
 
def hash():
 
    mes=""
    if mode=="先手":mes=mes+"Q"
    if mode=="後手":mes=mes+"E"
    if mode=="先手勝利":mes=mes+"N"
    if mode=="後手勝利":mes=mes+"S"     
 
    for i in hand:
       if i=="先手":mes=mes+"W"
       if i=="後手":mes=mes+"Z"
 
    for s in pos:
        mes=mes+str(s)
 
    return mes
 
 
koma=["王","金","銀","王","金","銀"]
ban=[]
ban.append([0,0])
for y1 in [1,2,3]:
    for x1 in [1,2,3]:
        ban.append([x1,y1])
don=[]
for r in range(100):
 
    pos=[2,1,3,8,7,9] 
    hand=["先手","先手","先手","後手","後手","後手"]
    mode="先手"
 
    de=[]
    de.append(hash())
 
    tr=0
 
    while tr<51:
 
        tr=tr+1
 
        sub=sho.sho()
        sub.pos=pos
        sub.hand=hand
        sub.mode=mode
        sub.ban=ban
        sub.koma=koma
        sub.game()
        mode=sub.mode
        pos=sub.pos
        hand=sub.hand
 
 
        if mode=="先手勝利":
           tr=100
        if mode=="後手勝利":
           tr=100
 
        de.append(hash()) 
 
    don.append(de)
 
print(don)      
最終更新:2018年02月15日 19:22