#include int m[3][3]={ {0, 0 ,0}, {0, 0, 0}, {0, 0, 0} }; void trykivalja(void){ int i,j; printf("%c", 177); printf("%c", 177); printf("%c", 177); printf("1"); printf("%c", 177); printf("2"); printf("%c", 177); printf("3"); printf("%c", 177); printf("\n"); for(i=0; i<3; i++){ printf("%d ",i+1); for(j=0; j<3; j++){ switch(m[i][j]){ case 0: printf(" "); break; case 1: printf(" X"); break; case 2: printf(" O"); break; } } printf("\n"); } return; } int main(void){ char t, tk, foo, space; int kood=(int)t; int koodkuhu=(int)tk; int x, y; int i,j; char ridac,veergc, enter; int rida, veerg; int kellekord=1; trykivalja(); //Mäng printf("Kuhu k2ia soovid: "); scanf("%c%c%c", &ridac,&veergc,&enter); rida=ridac-49; veerg=veergc-49; if(m[rida][veerg]==0){ m[rida][veerg]=kellekord; } if(kellekord==1){ kellekord=2; }else{ kellekord=1; } trykivalja(); system ("PAUSE"); return 0; }