Tic 085823
Tic 085823
#include <iostream>
void viewboard();
void newGame();
char mv[10]={'0','1','2','3','4','5','6','7','8','9'};
void resetboard()
mv[1]='1',mv[2]='2',mv[3]='3',mv[4]='4',mv[5]='5',mv[6]='6',mv[7]='7',mv[8]='8',mv[9]='9';
void viewboard()
void newGame()
int move,turn=0,win=0;
viewboard();
char desicion;
do
resetboard();
do
char xo;
if(turn%2==0)
xo='X';
}else{
xo='O';
cin>>move;
if(move>9 || move<1)
goto m;
}else{
if(mv[move]=='X' || mv[move]=='O')
cout<<"Place is occupied!";
turn++;
mv[move]=xo;
viewboard();
}else{
cout<<"error...";
turn=9;
turn=9;
turn=9;
turn=9;
turn=9;
}else if(turn==9){
cout<<"It's a DRAW!";
}while(turn!=9);
cin>>desicion;
}while(desicion=='y');
int main()
newGame();
return 0;