I said omit all occurrences of spots, not just the one in main.
I was tinkering around with your program some--
#include<iostream>
using namespace std;
const int num_rows = 3;
const int num_colm = 3;
int inputCount = 0;
bool taken[9] = {false, false, false, false, false, false, false, false, false};
void xPlayer(char board[][num_colm], int);
void oPlayer(char board[][num_colm], int);
bool checkBoardX(char board[][num_colm], int);
bool checkBoardO(char board[][num_colm], int);
int main()
{
int X;
int O;
char board[num_rows][num_colm] = {{1,2,3},{4,5,6},{7,8,9}};
cout << "TIC-TAC-Toe" << endl;
for(int i=0; i < num_rows; i++)
{
for(int j=0; j<num_colm; j++)
{
board[i][j] += 48;
cout << board[i][j];
cout << " ";
}
cout << endl;
}
cout << "^Beginning Board^"<<endl;
while(true){
if(!checkBoardO(board, num_rows) && inputCount < num_rows * num_colm)
xPlayer(board, num_rows);
else break;
if(!checkBoardX(board, num_rows) && inputCount < num_rows * num_colm)
oPlayer(board, num_rows);
else break;
}
if(checkBoardX(board, num_rows))
cout << "Player X wins" <<endl;
else if(checkBoardO(board, num_rows))
cout << "Player O wins" <<endl;
else cout << "Neither player won!" << endl;
cin.ignore();
cin.get();
return 0;
}
void xPlayer(char board[][num_colm], int num_rows)
{
int move;
for(int i = 0; i < 3; i++)
{
for(int j = 0; j < num_rows; j++)
{
cout << board[i][j];
cout << " ";
}
cout << endl;
}
bool validMove;
do{
validMove = true;
cout << "Player X, please make your move (1-9): ";
cin >> move;
validMove = (move > 0 && move < 10);
if(!validMove){
cout << "Your pick was not in the range 1 - …