But now can't finish it.. I can't figure out how to make the board display after every turn. Can anyone help?
#include <iostream>
using namespace std;
void showBoard (char t[3][3]);
int main ()
{
char player;
char t[3][3] = {{'1', '2', '3'}, {'4', '5', '6'}, {'7', '8', '9'}};
int place = 0;
for (int i = 0; i < 9; i++)
{
if ( i%2 == 0)
{ cout << "Place X (1-9): "; player = 'X';}
else
{ cout << "Place O (1-9): "; player = 'O';}
cin >> place;
}
switch (place)
{ case 1: t[0][0] = player;
break;
case 2: t[0][1] = player;
break;
case 3: t[0][2] = player;
break;
case 4: t[1][0] = player;
break;
case 5: t[1][1] = player;
break;
case 6: t[1][2] = player;
break;
case 7: t[2][0] = player;
break;
case 8: t[2][1] = player;
break;
case 9: t[2][2] = player;
break;
}
for (int i = 0; i < 3; i++)
{ for (int j = 0; j < 3; j++)
cout << t[i][j];
cout << endl;
}
return 0;
}