here is the program :
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
#include <iostream>
using namespace std;
int main()
{
int A[3][3]={{1,1,1},{1,1,1},{1,1,1}};
int row,col,crow,ccol,w=0;
int xo=0;
int yo=8;
for(int coin=0;coin<=1;coin){
//Display Module
for(int p1=0;p1<3;p1++){
cout<<"\n \n "<<endl;
for(int p2=0;p2<3;p2++){
cout<<A[p1][p2]<<" ";
}
}
//Game Engine(input Module)
cout<<"\n \n \nEnter the Row number"<<endl;
cin>>row;
crow=row-1;
cout<<"Enter the Column Number"<<endl;
cin>>col;
ccol=col-1;
w++;
if(w%2==0){
A[crow][ccol]=xo;
}
else{
A[crow][ccol]=yo;
}
//Winning Algorithm
if(yo==A[0][0]==A[0][1]==A[0][1]){
cout<<"Player 1 Wins !!!"<<endl;
}
}
return 0;
}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
well i am trying to do it step by step but when i type enter value row=1 and column=1 then it automatically shows up Player 1 wins although i it has to make a row of it = each other ........Also i know the winning algorithm is incomplete but it is not working in it base .....
Aslo pls tell me what i am doing wrong and feel free to suggest better way of handling it....
Also i am programming on Code Blocks
Also i am a newbie to C++ so keep the stuff basic(it is an incomplete program)