Skip to content

Instantly share code, notes, and snippets.

View obakanue's full-sized avatar

Sofi Flink obakanue

  • LTH
  • Lund, Sweden
View GitHub Profile
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],
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)
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])