From 15a834488b8205e96d2d12232a5c5e96cbb99ca2 Mon Sep 17 00:00:00 2001 From: Nemo D'ACREMONT Date: Sun, 18 May 2025 14:53:23 +0200 Subject: [PATCH] fix pass --- go_player/myPlayer.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/go_player/myPlayer.py b/go_player/myPlayer.py index 3ec7418..a6a3209 100644 --- a/go_player/myPlayer.py +++ b/go_player/myPlayer.py @@ -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: