i want to make XO Game .......

any one can help Me ??
You mean "noughts and crosses" or "tic-tac-toe"? You'll need to provide us with at least something. We aren't going to do it for youo.
Programming might not be the right thing for you, as it involves both typing and thinking, neither of which seems to be your strength.
First you'll need a multimedia library such as SFML (http://sfml-dev.org )

It will allow you to load and draw images, load and play sounds, handle input etc. However, you will need basic knowledge of how to use C++ classes.
int main()
{
char xo[4][4];
int x,y;
char m,p11,p22;
string p1,p2;
cout<<"1st player <ENTER Your NAME>\n"<<endl;
cin>>p1;
cout<<endl<<endl;
cout<<"2nd player <ENTER Your NAME>\n"<<endl;
cin>>p2;
cout<<endl<<endl;
cout<<p1<<" Please Select X OR O the Press Enter\n"<<endl;
cin>>m;
cout<<endl;
if(m=='X'||m=='x')
{
p11='x';
p22='o';
}
else if (m=='O'||m=='o')
{
p11='o';
p22='x';
}
else
{
cout<<"wrong value\n";
exit(0);
}
for(int i=0;i<16;i++)
{


cout<<p1<<endl<<endl; //ply 1
for(int i=0;i>=0;i++)
{
cout<<"Please Enter The Number Of the row\n";
cin>>x;
cout<<"Please Enter The Number Of the Column\n";
cin>>y;
if(x>3||y>3)
{
cout<<"Please enter the numbers for the row and column less than 4\n"<<endl;



for(int i=0;i<4;i++) //screen
{
for(int j=0;j<4;j++)
{
cout<<xo[i][j]<<" ";
}
cout<<endl;
}

cout<<endl<<endl<<"Enter Again\n"<<endl<<endl;

continue;
}
else if(xo[x][y]=='x'||xo[x][y]=='o')
{
cout<<"This place is full \n"<<endl<<endl;



for(int i=0;i<4;i++) //screen
{
for(int j=0;j<4;j++)
{
cout<<xo[i][j]<<" ";
}
cout<<endl;
}

cout<<endl<<endl<<"Enter Again\n"<<endl<<endl;

continue;
}
else
break;
}
cout<<endl<<endl;




xo[x][y]=p11;





for(int i=0;i<4;i++) //screen
{
for(int j=0;j<4;j++)
{
cout<<xo[i][j]<<" ";
}
cout<<endl;
}



/* for(int i=0;i<4;i++) //test1
{
for(int j=0;j<4;j++)
{
if(xo[i][i]=='x'||xo[i][i]=='o'||xo[j][i]=='x'||xo[j][i]=='o'||xo[i][j]=='x'||xo[i][j]=='o')

cout<<"Player 1 WIN \n";

}

}
for(int i=0;i<=3;i++) //test1 qutr
{
for(int j=3;j>=0;j--)
if(xo[i][j]=='x'||xo[i][j]=='o')
cout<<"Player 1 WIN \n";
}
*/

cout<<endl<<endl;

cout<<"NEXT PLAYER\n"<<endl;



cout<<p2<<endl<<endl; //ply 2
for(int i=0;i>=0;i++)
{
cout<<"Please Enter The Number Of the row\n";
cin>>x;
cout<<"Please Enter The Number Of the Column\n";
cin>>y;
if(x>3||y>3)
{
cout<<"Please enter the numbers for the row and column less than 4\n"<<endl;



for(int i=0;i<4;i++) //screen
{
for(int j=0;j<4;j++)
{
cout<<xo[i][j]<<" ";
}
cout<<endl;
}

cout<<endl<<endl<<"Enter Again\n"<<endl<<endl;

continue;
}
else if(xo[x][y]=='x'||xo[x][y]=='o')
{
cout<<"This place is full \n"<<endl<<endl;



for(int i=0;i<4;i++) //screen
{
for(int j=0;j<4;j++)
{
cout<<xo[i][j]<<" ";
}
cout<<endl;
}

cout<<endl<<endl<<"Enter Again\n"<<endl<<endl;

continue;
}
else
break;
}
cout<<endl<<endl;
xo[x][y]=p22;


for(int i=0;i<4;i++) //screen
{
for(int j=0;j<4;j++)
{
cout<<xo[i][j]<<" ";
}
cout<<endl;
}



/* for(int i=0;i<4;i++) //test2
{
for(int j=0;j<4;j++)
{
if(xo[i][i]=='x'||xo[i][i]=='o'||xo[j][i]=='x'||xo[j][i]=='o'||xo[i][j]=='x'||xo[i][j]=='o')

cout<<"Player 2 WIN \n";

}

}
for(int i=0;i<=3;i++) //test2 qutr
{
for(int j=3;j>=0;j--)
if(xo[i][j]=='x'||xo[i][j]=='o')
cout<<"Player 2 WIN \n";
}

*/

cout<<"NEXT PLAYER\n"<<endl;
cout<<endl<<endl;
}

cout<<"NO ONe Win\n";
exit(0);












return 0;
}



i make the program but i cannot make the condition tow know who win >>>
Topic archived. No new replies allowed.