קוד:
#include <stdio.h>
#include <conio.h>
void xcp(int xcf[9]){
int i,j = 0;
for(i = 0;i < 9;i++){
j = 1;
if(j == 3){
printf("|%d|\n",xcf[i]);
printf("\n|_||_||_|\n");
j = 1;
}else{
printf("|%d|",xcf[i]);
j++;
}
}
}
void main(){
int go = 1,i,xc[9]= {1,2,3,4,5,6,7,8,9},sh = -1,select,xioi = 88,b = 2;
do{
xcp(xc);
printf("\n\n\tnow play %c\n\t ",xioi);
scanf("%d",&select);
for(i = 0;i <= 9;i++){
if(select == i){
xc[i - 1] = xioi;
b = 1;
}
if(b == 1)
break;
}
b = 2;
printf("%d\n",xioi);
sh *= -1;
if(sh == 1)
xioi = 79;
else
xioi = 88;
/* printf("%c\n",88);*/
}while(go == 1);
}