From c4358b19e30cc5bc765e207cd6abe1fb328bd02b Mon Sep 17 00:00:00 2001 From: Nemo D'ACREMONT Date: Sun, 18 May 2025 22:04:22 +0200 Subject: [PATCH] fix crash --- go_player/moveSearch.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/go_player/moveSearch.py b/go_player/moveSearch.py index 0f005d3..444f736 100644 --- a/go_player/moveSearch.py +++ b/go_player/moveSearch.py @@ -1,4 +1,4 @@ -from sys import stderr + from sys import stderr import time import math from typing import Any, Callable @@ -17,8 +17,8 @@ def _alphabeta( if board.is_game_over() or depth == 0: return heuristic(board, color), None - wantMax = board.next_player() == color - best_move = None + wantMax = (board.next_player() == color) + best_move = -1 if wantMax: acc = -math.inf @@ -92,7 +92,7 @@ def IDDFS( max_depth: int = 10, duration: float = 5.0, # Duration in seconds ): - best_move = None + best_move = -1 start_time = time.time() shouldStop = lambda: (time.time() - start_time) >= duration