generalized tic-tac-toe