Skip to content

Instantly share code, notes, and snippets.

@tarynsauer
Created December 8, 2013 23:46
Show Gist options
  • Save tarynsauer/7865261 to your computer and use it in GitHub Desktop.
Save tarynsauer/7865261 to your computer and use it in GitHub Desktop.
def apply_minimax(board, player, cell, depth, alpha, beta)
return get_score(board, player) if board.game_over?
if player.current_player?
maximizing_player = Maximizing.new(player)
alphabeta(board, maximizing_player, depth, alpha, beta)
else
minimizing_player = Minimizing.new(player)
alphabeta(board, minimizing_player, depth, alpha, beta)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment