fix pass
This commit is contained in:
parent
3b2fe7671d
commit
15a834488b
@ -177,20 +177,21 @@ class myPlayer(PlayerInterface):
|
||||
duration = 1.
|
||||
|
||||
if self._board._nbBLACK + self._board._nbWHITE < 10:
|
||||
duration = 3
|
||||
duration = 1
|
||||
|
||||
elif self._board._nbBLACK + self._board._nbWHITE < 30:
|
||||
duration = 5
|
||||
duration = 1
|
||||
|
||||
elif self._board._nbBLACK + self._board._nbWHITE > 40:
|
||||
duration = 64 - (self._board._nbBLACK + self._board._nbWHITE)
|
||||
duration = 1 # 64 - (self._board._nbBLACK + self._board._nbWHITE)
|
||||
|
||||
duration = min(duration, (self.maxtime - self.time) / 10)
|
||||
move = -1
|
||||
score = 0
|
||||
|
||||
b, w = self._board.compute_score()
|
||||
# move = alphabeta(self._board, self.nnheuristic, self._mycolor, 1)
|
||||
if self.last_op_move == "PASS" and self._board.diff_stones_board() * (1 if self._mycolor == Goban.Board._BLACK else -1) > 0:
|
||||
if self.last_op_move == "PASS" and (b - w) * (1 if self._mycolor == Goban.Board._BLACK else -1) > 0:
|
||||
move = -1
|
||||
score = math.inf
|
||||
|
||||
@ -225,7 +226,6 @@ class myPlayer(PlayerInterface):
|
||||
|
||||
def newGame(self, color):
|
||||
self._mycolor = color
|
||||
self._opponent = Goban.Board.flip(color)
|
||||
|
||||
def endGame(self, winner):
|
||||
if self._mycolor == winner:
|
||||
|
Loading…
x
Reference in New Issue
Block a user