From 06a35bda10495e8babce8419cb8f4ebea6b74556 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Thu, 20 Feb 2025 23:45:49 -0500 Subject: [PATCH] fix 'attempt to negate with overflow' --- src/logic/move.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/logic/move.rs b/src/logic/move.rs index cfe2824..d576292 100644 --- a/src/logic/move.rs +++ b/src/logic/move.rs @@ -74,10 +74,10 @@ impl Move { // if this board results in the opponent winning, MAJORLY negatively weigh this move // NOTE! this branch isn't completely deleted because if so, the bot wouldn't make a move. // We shouldn't prune branches because we still need to always react to the opponent's moves - return i64::MIN; + return i64::MIN + 1; } else if self.winner == Winner::Player(agent_color) { // results in a win for the agent - return i64::MAX; + return i64::MAX - 1; } else if self.winner == Winner::Tie { // idk what a Tie should be valued? return 0;