generalize TTT to larger boards