AI code for tic tac toe