so i have this tic tac toe assignment in c++ and i need some help doing the moves part for both the computer and the player....i already got the board down with arrays and the specs for the functions needed are listed below...some help would be greatly appricaited and i dont need the WHOLE thing just how to start it off...thanks!
the board looks like this:
123
456
789
basically the player picks a number and an X is placed in the number and then the computer automatically makes another move, etc.
/**
* Displays the current game board.
*
* @param board The game board.
* @param size The number of elements in the game board.
*/
void displayBoard(const char board[], int size);
/**
* Prompts for a move and makes the move if valid.
* Otherwise, posts an error message and asks the
* user to enter a correct move.
*
* @param board The game board.
* @param prompt Message to display to the user.
* @param player Name of the player ('X' or 'O').
* @return The play made or -1 if the player exits the game.
*/
int move(char board[], int size, string prompt, char player);
/**
* Checks to see if the game has a winner.
*
* @param board The game board.
* @return true if a winner was found, otherwise false.
*/
bool checkWinner(const char board[]);