// Can have 2 people play ( x and o)
// or a single person can play the computer
#include <iostream>
#include <iomanip>
usingnamespace std;
constint N = 3;
void intBoard(char bd[N][N]);
void printBoard(char bd[N][N]);
int mian(void){
char board[N][N];
intBoard(board);
printBoard(board);
return 0;
}
void intBoard(char bd[N][N]){
int i, j;
for (i = 0; i < N; i++)
for (j = 0; j < N; j++)
bd[i][j] = ' ';
}
void printBoard(char bd[N][N]){
// haw many '-' we want per column
int i, j, k;
for (i = 0; i < N; i++){
for (j = 0; j < N; j++)
cout << "----";
cout << "-\n";
for (j = 0; j < N; j++){
cout << "| " << bd[i][j] << " ";
cout << "-|\n"; // todo: output the row
}
for (j = 0; j < N; j++)
cout << "----";
cout << "-\n";
}
it looks like its in the bottom function.
its hard to tell which one because the style you used does not align braces. I won't help you until they align vertically. I know I am in the minority, but you won't have this problem if you code like below, with a comment on each ending brace and vertical alignment:
1 2 3 4 5 6 7
code
{ //on a line by itself
if (x)
{ // on a line by itself
stuff
} //end if x aligned!
} //end 'code' aligned!
Printed books need to use
code { //save empty lines and printing costs