import numpy as np
import game
def hash(m1,h1,p1):
ha=""
if m1=="先手":ha=ha+"w"
if m1=="後手":ha=ha+"x"
if m1=="先手勝利":ha=ha+"y"
if m1=="後手勝利":ha=ha+"z"
for h2 in h1:
if h2=="先手":ha=ha+"p"
if h2=="後手":ha=ha+"q"
alp=["a","b","c","d","e","f","g","h","i","j"]
for p2 in p1:
ha=ha+alp[p2]
return ha
g=open("point.txt","r",encoding="utf-8")
dic=[""]
point=[50]
for line in g:
q1=line.split(",")
dic.append(q1[0])
pxs=int(q1[1])
point.append(pxs)
print(point)
g.close()
koma=["王","金","銀","王","金","銀"]
ban=[]
ban.append([0,0])
for y1 in [1,2,3]:
for x1 in [1,2,3]:
ban.append([x1,y1])
delta=[]
for de in range(1000):
pos=[2,1,3,8,7,9]
hand=["先手","先手","先手","後手","後手","後手"]
mode="先手"
sig=[]
tr=0
while tr<50:
sub2=game.game()
sub2.koma=koma
sub2.pos=pos
sub2.ban=ban
sub2.hand=hand
sub2.mode=mode
sub2.dic=dic
sub2.point=point
sub2.makedata()
pos=sub2.pos
mode=sub2.mode
hand=sub2.hand
if mode=="先手勝利":tr=100
if mode=="後手勝利":tr=100
mes=hash(mode,hand,pos)
sig.append(mes)
delta.append(sig)
f=open("dic.txt","w",encoding="utf-8")
for d1 in delta:
f.write(d1[0])
for i in range(len(d1)-1):
f.write(","+d1[i+1])
f.write("\n")
f.close()
最終更新:2018年02月18日 02:09