increased compatibility for other platforms by not Using MaxInt64
This commit is contained in:
parent
6616a89138
commit
f0f068af76
|
@ -1,7 +1,6 @@
|
||||||
package opponent
|
package opponent
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math"
|
|
||||||
"tictactoe/gameControl"
|
"tictactoe/gameControl"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -24,7 +23,7 @@ func Minimax(board [3][3]string, depth int, isMaximizingPlayer bool, player stri
|
||||||
// check who's turn it is
|
// check who's turn it is
|
||||||
if isMaximizingPlayer {
|
if isMaximizingPlayer {
|
||||||
// set max score
|
// set max score
|
||||||
bestScore := math.MinInt64
|
bestScore := -10000
|
||||||
var bestMove NextMove
|
var bestMove NextMove
|
||||||
// iterate through all fields
|
// iterate through all fields
|
||||||
for i := 0; i < 3; i++ {
|
for i := 0; i < 3; i++ {
|
||||||
|
@ -49,7 +48,7 @@ func Minimax(board [3][3]string, depth int, isMaximizingPlayer bool, player stri
|
||||||
return bestMove
|
return bestMove
|
||||||
} else {
|
} else {
|
||||||
// set min score
|
// set min score
|
||||||
bestScore := math.MaxInt64
|
bestScore := +10000
|
||||||
var bestMove NextMove
|
var bestMove NextMove
|
||||||
// iterate through all fields
|
// iterate through all fields
|
||||||
for i := 0; i < 3; i++ {
|
for i := 0; i < 3; i++ {
|
||||||
|
|
Loading…
Reference in New Issue