/*********************/
/***** Black Bird ****/
/*********************/



#include <stdio.h>
#include <tos.h>
#include <ext.h>

int tic[3][3]={0,0,0,0,0,0,0,0,0},x,y;
int kx,ky,i;
main()
{
		printf("%c%c",27,'E');
				printf("\n***********************\n* Black Bird presents *\n***********************\n******* PRG ONE *******\n***********************\n");

		printf("%c%c",27,'E');
tac();
for(i=0;i<5;++i)
{   printf("Player 1 : Eingabe der Koordinate:");
	scanf("%d,%d",&kx,&ky);
	if(tic[kx][ky]==0)
	{	tic[kx][ky]=1;
		tac();}
	 	else
	 	printf("schon belegt !");
	
	
	printf("Player 2 : Eingabe der Koordinate:");
	scanf("%d,%d",&kx,&ky);
	
	if(tic[kx][ky]==0)
	{tic[kx][ky]=2;
	tac();}
	 else
	printf("schon belegt !");
	
 }	
}



tac()
{
printf("%c%c",27,'E');
	for(x=0;x<3;++x)
		{
			for(y=0;y<3;++y)	
				{
					if(tic[x][y]==0)
						printf(":");	
					if(tic[x][y]==1)
						printf("X");
					if(tic[x][y]==2)
						printf("O");
					
						if(y==2)
			 				printf("\n");
			 	}
		}

 for (y=1;y<3;++y)
 if(((tic[0][y]==tic[1][y])==tic[2][y])==2)
   printf("player 2 hat gewonnen");

 for (y=1;y<3;++y)
 if(((tic[y][0]==tic[y][1])==tic[y][2])==2)
   printf("player 2 hat gewonnen");


 return(0);
}

