This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
def main(): | |
global mainBoard | |
global playerTile | |
global computerTile | |
global pointsMatrix | |
pointsMatrix = [[10, -10, 3, 3, 3, 3, -10, 10], | |
[-10, -10, -3, -3, -3, -3, -10, -10], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def min_max(board, depth, maximizingPlayer): | |
validMoves = get_valid_moves(board) | |
bestMove = [-1,-1] | |
if depth == 0 or validMoves == []: | |
return evaluate_score(board) | |
# no indent here | |
if maximizingPlayer: | |
maxEval = -sys.maxsize | |
for move in validMoves: | |
child = get_board_copy(board) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def min_max(board, depth, maximizingPlayer): | |
validMoves = get_valid_moves(board) | |
bestMove = [-1,-1] | |
if depth == 0 or validMoves == []: | |
return evaluate_score(board) | |
if maximizingPlayer: | |
maxEval = -sys.maxsize | |
for move in validMoves: | |
child = get_board_copy(board) | |
make_move(child, computerTile, move[0], move[1]) |