import numpy as np
def hash():
strx=""
if mode==1:strx="A"
if mode==2:strx="B"
for x1 in x:
if x1==0:strx=strx+"C"
if x1==1:strx=strx+"D"
if x1==1:strx=strx+"E"
return strx
delta=[]
for trial in range(100):
x=[0,0,0,0,0,0,0,0,0]
mode=1
strx=hash()
h=0
if strx in delta:h=100
if h<50:delta.append(strx)
sig=[strx]
game=0
while game<50:
q=[]
for i in range(9):
if x[i]==0:q.append(i)
c1=np.random.choice(q)
x[c1]=mode
mm=mode
if mm==1:mode=2
if mm==2:mode=1
strx=hash()
h=0
if strx in delta:h=100
if h<50:delta.append(strx)
sig.append(strx)
m=0
for i in range(9):
if x[i]>0:m=m+1
if m==9:game=100
print(sig)
print(delta)
最終更新:2018年02月14日 20:18