アットウィキロゴ

まきぐち

import masu
 
def win(mode):
 
    mm=mode
    if mm=="先手":
       mode="後手"
    if mm=="後手":
       mode="先手"
 
    if hand[0]=="後手":
       mode="後手勝利" 
    if hand[3]=="先手":
       mode="先手勝利" 
 
    return mode
 
 
koma=["王","歩","歩","王","歩","歩"]
ban=[]
ban.append([0,0])
for y1 in [1,2,3]:
    for x1 in [1,2,3]:
        ban.append([x1,y1])
 
pos=[2,1,3,8,7,9]
 
hand=[]
hand.append("先手")
hand.append("先手")
hand.append("先手")
hand.append("後手")
hand.append("後手")
hand.append("後手")
 
mode="先手"
 
tr=0
while tr<40:
 
    tr=tr+1
 
    sub=masu.masu()
    sub.koma=koma
    sub.ban=ban
    sub.hand=hand
    sub.pos=pos
    sub.mode=mode
    sub.makedata()
    hand=sub.hand
    pos=sub.pos
 
    mode=win(mode)
 
    print(mode)
 
    if mode=="先手勝利":
       tr=100
    if mode=="後手勝利":
       tr=100
最終更新:2018年01月14日 12:52