alpha-beta(player,board,alpha,beta)
if(game over in current board position)
return winner
children = all legal moves for player from this board
if(max's turn)
for each child
score = alpha-beta(other player,child,alpha,beta)
(we have found a better best move....)
if score > alpha then alpha = score (cut off...)
if alpha >= beta then return alpha
return alpha (this is our best move)
else (min's turn)
for each child
score = alpha-beta(other player,child,alpha,beta)
(opponent has found a better worse move.....)
if score < beta then beta = score
(cut off....)
if alpha >= beta then return beta
return beta (this is the opponent's best move)