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