I am trying to build a m*n Tic-Tac-Toe using numpy to maintain my game-state. To evaluate a win, we need atleast 'q' continuous blocks of an element in either row, columns or along the diagonals. (3 in case of the original tic-tac-toe).
One crude approach I have currently implemented currently is to generate all the row, column and vectors along the diagonal path and then iterate over each of them to find a continious block of 'q' using iteration.
I would want to optimize it further. Since, I am relatively new to working with numpy and computation using matrices, I want to know if we can do it in any better fashion, more specifically, if I can better leverage numpy functionalities to do some more of these computations.