Tic-Tac-Toe Game in C
Name: Riya Patel, UWin No: 105159179
Function: printMenu()
This function displays a menu of options for the user to interact with the Tic-Tac-Toe game.
Function: InitializeBoard(int m, int n, char board[][n])
This function initializes the Tic-Tac-Toe board with numbers from 1 to 9, representing the cells.
Function: PrintBoard(int m, int n, char board[][n])
This function prints the current state of the Tic-Tac-Toe board, displaying the X’s, O’s, and empty cells.
Function: CreateBoard(int m, int n, char board[][n])
This function allows the user to create a custom Tic-Tac-Toe board by specifying the cell number and the symbol (X or O) to place in that cell.
Function: IsValidBoard(int m, int n, char board[][n])
This function checks if the current Tic-Tac-Toe board is valid based on the number of X’s and O’s. A valid board must have a difference of no more than one between the number of X’s and O’s.
Function: checkRowCrossed(int n, char board[][n], char checkMe)
This function checks if a row is crossed with the specified symbol (X or O). It returns 1 if a row is crossed and 0 otherwise.
Function: checkColumnCrossed(int n, char board[][n], char checkMe)
This function checks if a column is crossed with the specified symbol (X or O). It returns 1 if a column is crossed and 0 otherwise.
Function: checkDiagonalCrossed(int n, char board[][n], char checkMe)
This function checks if a diagonal is crossed with the specified symbol (X or O). It returns 1 if a diagonal is crossed and 0 otherwise.
Function: ListWinningCells(int m, int n, char board[][n])
This function lists the potential winning cells for both players (X and O) based on the current state of the board.
Function: main()
The main function is the entry point of the program. It initializes the board, displays the menu, and handles user input to perform various operations on the Tic-Tac-Toe game.