From f0f068af76774ebe819de5186cd71237efacc50a Mon Sep 17 00:00:00 2001 From: Falko Habel Date: Sat, 18 May 2024 23:50:10 +0200 Subject: [PATCH] increased compatibility for other platforms by not Using MaxInt64 --- opponent/minimax.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/opponent/minimax.go b/opponent/minimax.go index 96a6df6..56710b1 100644 --- a/opponent/minimax.go +++ b/opponent/minimax.go @@ -1,7 +1,6 @@ package opponent import ( - "math" "tictactoe/gameControl" ) @@ -24,7 +23,7 @@ func Minimax(board [3][3]string, depth int, isMaximizingPlayer bool, player stri // check who's turn it is if isMaximizingPlayer { // set max score - bestScore := math.MinInt64 + bestScore := -10000 var bestMove NextMove // iterate through all fields for i := 0; i < 3; i++ { @@ -49,7 +48,7 @@ func Minimax(board [3][3]string, depth int, isMaximizingPlayer bool, player stri return bestMove } else { // set min score - bestScore := math.MaxInt64 + bestScore := +10000 var bestMove NextMove // iterate through all fields for i := 0; i < 3; i++ {