I am attempting to find a strategy for the second player that leads to a forced draw in the case of a general NxN TicTacToe game where N fields in a row/column or diagonal are required to win the game. Up to 4 the perfect game is pretty obvious but after that Im not sure how to formulate such a strategy.
I have thought about the fact that if Player 2 manages to block every Column and Row (which at least takes N moves) Player 1 cannot win. It seems very easily doable since it takes at least 2N moves from both for the first winning chance of player 1 to even appear but I struggle to formulate it in a way such that there is no doubt, that this is actually possible and that player 1 has no dominant strategy.
In principle the background to this is, that I have to show, that NxN TicTacToe is a draw but I fail at formulating this in a mathematically correct way.
Look at this arrangement:
If the first player plays in any cell with a letter, then the second player replies by playing in the other cell with that letter. Every row, column, and diagonal contains a pair of identical letters, so all lines will be blocked.
This pattern can fairly easily be generalised to larger board sizes. For size 5 you'll need a slight variation of it to get the diagonals to work.