The game is a simple version of tic tac toe which this YouTuber made rules of the game are simple
- tic-tac-toe like 3 x 3 Grid
- p1 can place horizontal marks and p2 can place vertical marks
- players cant mark on location just previously marked by another player
- players cant mark on their own mark
- whoever makes a row, col, or diagonal of both marks wins first
since the game cannot be a draw and moves are finite at max 9^15 (the game has to finish in 15 moves in any circumstance) who has more advantage p1 or p2? and what would the best strategy to play be like I ran a python code for the same and got about a million win sequences it was nowhere near done so was thinking is there any mathematical way to solve this
I think this game is a win for the second player. To describe the strategy let me first define some notation.
The top left corner is $(1,1)$ and the bottom right corner is $(3,3)$ in general $(i,j)$ is the i-th row and j-th column. The corners are $C = \{(1,1), (1,3), (3,1), (3,3)\}$, the sides are $S = \{(1,2), (2,1), (2,3), (3,2)\}$, and the middle is $M = \{(2,2)\}$.
Player 2's first 6 moves will make the pattern
$ | X | X | \phantom{X} | \\ | X | \phantom{X} | X | \\ | \phantom{X} | X | X | $
or
$ | \phantom{X} | X | X | \\ | X | \phantom{X} | X | \\ | X | X | \phantom{X} | $
Here is the list of rules for player 2 to always win:
At this point, player 2 will have one of the two patterns above and there is one corner that has both players' mark. Player 1 would have placed 7 marks (and 1 is a shared corner).
You can check for yourself if player 2 makes one of the two patterns above and player 1 has placed 7 marks (with 1 shared corner) then player 2 will always win. The key is that player 2 shares a corner with player 1 when reaching this position.