I'm building a Tic-Tac-Toe game project with C#. My teacher asked me to create an array while its size is the max number of diagonal sequences that are possible in the specific board size (Not only 3x3). Problem now, is that my teacher gave me a wrong formula and it won't calculate it right. For example, in a 3x3 board, there should be 2 possible diagonal sequences, but the formula calculates only 1.
This is the formula: (rows-sequence+1)*(cols-sequence+1).
Which means: (3-3+1)*(3-3+1) = 1
If someone knows the correct formula, I'll be grateful!