class Board
{
private char[,] board;
/// <summary>
/// Get whether the board is valid, i.e. the board is a 3x3 board with only 'X', 'O' and '.' characters
/// and the number of 'X' is equal to or one more than the number of 'O'
/// </summary>
/// <returns>True if the board is valid, false otherwise</returns>
///
// Need to also make sure that the number of o is not 1 less than x as x goes first.
public bool IsValid()
{
// CHeck if both the rows and column of the board are in 3x3
if (board.GetLength(0) != 3)
return false;
else if (board.GetLength(1) != 3)
return false;
else return true;
}
/// <summary>
/// Constructor of the Board class. Fill the 2D board of characters using the lines array of strings.
/// </summary>
/// <param name="lines">The array of strings to fill the 2D board of characters</param>
public Board(string[] lines)
{
// Constructor that creates a 3x3 array of characters (char)
board = new char[3, 3];
}
class Board
{
private char[,] board;
/// <summary>
/// Get whether the board is valid, i.e. the board is a 3x3 board with only 'X', 'O' and '.' characters
/// and the number of 'X' is equal to or one more than the number of 'O'
/// </summary>
/// <returns>True if the board is valid, false otherwise</returns>
///
// Need to also make sure that the number of o is not 1 less than x as x goes first.
public bool IsValid()
{
// CHeck if both the rows and column of the board are in 3x3
if (board.GetLength(0) != 3)
return false;
else if (board.GetLength(1) != 3)
return false;
else return true;
}
/// <summary>
/// Constructor of the Board class. Fill the 2D board of characters using the lines array of strings.
/// </summary>
/// <param name="lines">The array of strings to fill the 2D board of characters</param>
public Board(string[] lines)
{
// Constructor that creates a 3x3 array of characters (char)
board = new char[3, 3];
}