EDN Admin
Well-known member
<pre class="prettyprint #include <iostream>
using namespace std;
const int N=9;
char board[N][N];
void board_initial(int&a);
void board_show(int&b);
void board_initial(int&a)
{
for (int i=0; i<a; i++)
{ for (int j=0; j<a; j++)
board[j]=*;
}
}
void board_show(int&b)
{
cout<<endl<<endl<<endl;
for (int i=0; i<b; i++)
{
for (int j=0; j<b; j++)
{ if (j==0)
{ cout<<" "<<board[j];
cout<<" |";
}
if (j<(b-2))
{ cout<<" "<<board[j];
cout<<" |";
}
if (j==(b-1))
cout<<board[j];
}
cout<<endl;
if (i==b-1)
break;
for (int j=0; j<b; j++) //in a straight line for grid
{
if(j==0)
cout<<" ___|";
else if (j<=(b-2) )
cout<<"___|";
else if (j==(b-1))
cout<<"___";
}
cout<<endl;
}
}
[/code]
Hello,
I am trying to make an N*N tic tac toe table. But during compiling visual studio gives this error. Any help would be appreciated.
View the full article
using namespace std;
const int N=9;
char board[N][N];
void board_initial(int&a);
void board_show(int&b);
void board_initial(int&a)
{
for (int i=0; i<a; i++)
{ for (int j=0; j<a; j++)
board[j]=*;
}
}
void board_show(int&b)
{
cout<<endl<<endl<<endl;
for (int i=0; i<b; i++)
{
for (int j=0; j<b; j++)
{ if (j==0)
{ cout<<" "<<board[j];
cout<<" |";
}
if (j<(b-2))
{ cout<<" "<<board[j];
cout<<" |";
}
if (j==(b-1))
cout<<board[j];
}
cout<<endl;
if (i==b-1)
break;
for (int j=0; j<b; j++) //in a straight line for grid
{
if(j==0)
cout<<" ___|";
else if (j<=(b-2) )
cout<<"___|";
else if (j==(b-1))
cout<<"___";
}
cout<<endl;
}
}
[/code]
Hello,
I am trying to make an N*N tic tac toe table. But during compiling visual studio gives this error. Any help would be appreciated.
View the full article