A java version of the modification for tic tac toe