Skip to content

Commit 57a3ea5

Browse files
committed
修正胜负判定
1 parent 75c56ec commit 57a3ea5

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

basic.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,6 @@ def game_end(node):
399399
break
400400
# 看上一手
401401
node_i = node_i.parent # 前面已经确定不是第二层,这里不用判断了
402-
print('模拟中实际未吃子次数',count)
403402

404403
if not isMoqi:
405404
return False, None
@@ -411,7 +410,7 @@ def game_end(node):
411410
else:
412411
_, _, isMove = node_i.move
413412
if not isMove: # 吃子了
414-
return False, node_i.isEne # 吃子是它的父节点走的,所以是isEne,相当于not not isEne
413+
return True, node_i.isEne # 吃子是它的父节点走的,所以是isEne,相当于not not isEne
415414
# 上次吃子不在模拟里
416415
if eneBeatHand > usBeatHand: # 大的后吃子,胜出
417416
return True, False

mcts.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def extend(self):
9494
else:
9595
condition = basic.IsMyChess(i,j,self.cMap)
9696
if condition:
97-
allPos=basic.getAccessibility(i,j,self.isEne,self.posList,self.cMap)
97+
allPos=basic.getAccessibility(i,j,self.isEne,self.posList,self.cMap,self.probTable)
9898
print('layer:', self.layer)
9999
for newi,newj in allPos:
100100
print('move:',j,i,newj,newi)

0 commit comments

Comments
 (0)