Generic tic tac toe program