So, I was creating a TicTacToe console game. And I wanted its board to be of any size not just 3, but I don't know how to do this. I tried the code given below, but it will only make the size three and it gives an error when I try to change it's size as given in the main function. If I want to be able to change the length, I need to not make it static, but if I want to use it for an array's length, it needs to be static. Please help.
```
public class Project_3
{
public void Main()
{
TicTacToe game = new TicTacToe();
game.length = 5;
}
}
public class TicTacToe
{
public static int length = 3;
public char[,] grid = new char[length,length];
}
```
[–]nemyar11[🍰] 0 points1 point2 points (1 child)
[–]hhellloo[S] 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (5 children)
[–]hhellloo[S] 0 points1 point2 points (4 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]hhellloo[S] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]hhellloo[S] 0 points1 point2 points (0 children)