The tic tac toe solving function with score and powers of 2