hey i am trying to write a program that allows two users to play tic tac toe....right now i am doing the program in pieces i have accomplished setting up the two dimensional array. i am having a problem changing the * thats in a section of array to an X or O. here's my code:
#include <iostream>
using namespace std;
int main()
{
char game[3][3]={{'*','*','*'},{'*','*','*'},{'*','*','*'}};
char choice;
int row, column;
cout<<"Lets play a game of TicTacToe! Here's the starting game board: "<<endl;
for(int i=0; i<3; i++)
{
for(int j=0; j<3; j++)
{
cout << game[i][j]<<" ";
}
cout<<endl;
}
cout<<"Are you X or O? ";
cin>>choice;
cout<<"Enter the row and column to place your "<<choice<<". ";
cin>>row>>column;
game[row][column]=choice;
for(int i=0; i<3; i++)
{
for(int j=0; j<3; j++)
{
cout << game[i][j]<<" ";
}
cout<<endl;
}
return 0;
}