Olvidenlo ya lo resolvi por si a alguien le sirve lo dejo aqui
Código C++:
Ver original#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char A[7][7];
int C=0,X,Y,turno1,turno2,t1=5,t2=5,t3=5,t4=5,t5=5,t6=5,t7=5,w1=0,w2=0,acabo=0;
for(X=0;X<=5;X++)
{
for(Y=0;Y<=6;Y++)
{
A[X][Y]='.';
}
}
for(X=0;X<=5;X++)
{
for(Y=0;Y<=6;Y++)
{
}
printf("\n ---------------------------\n"); }
do
{
switch(turno1)
{
case 1:
A[t1][turno1-1]='X';
t1=t1-1;
break;
case 2:
A[t2][turno1-1]='X';
t2=t2-1;
break;
case 3:
A[t3][turno1-1]='X';
t3=t3-1;
break;
case 4:
A[t4][turno1-1]='X';
t4=t4-1;
break;
case 5:
A[t5][turno1-1]='X';
t5=t5-1;
break;
case 6:
A[t6][turno1-1]='X';
t6=t6-1;
break;
case 7:
A[t7][turno1-1]='X';
t7=t7-1;
break;
}
for(X=0;X<=5;X++)
{
for(Y=0;Y<=6;Y++)
{
}
printf("\n ---------------------------\n"); }
//gano?
for(X=0;X<=5;X++)
{
for(Y=0;Y<=6;Y++)
{
if(A[X][Y]=='X' & A[X][Y+1]=='X' & A[X][Y+2]=='X' & A[X][Y+3]=='X'||A[X][Y]=='X' & A[X][Y-1]=='X' & A[X][Y-2]=='X' & A[X][Y-3]=='X'||A[X][Y]=='X' & A[X+1][Y]=='X' & A[X+2][Y]=='X' & A[X+3][Y]=='X'||A[X][Y]=='X' & A[X-1][Y]=='X' & A[X-2][Y]=='X' & A[X-3][Y]=='X'||A[X][Y]=='X' & A[X+1][Y+1]=='X' & A[X+2][Y+2]=='X' & A[X+3][Y+3]=='X'||A[X][Y]=='X' & A[X+1][Y-1]=='X' & A[X+2][Y-2]=='X' & A[X+3][Y-3]=='X')
{
w1=w1+1;
}
}
}
if(w1<1)
{
switch(turno2)
{
case 1:
A[t1][turno2-1]='O';
t1=t1-1;
break;
case 2:
A[t2][turno2-1]='O';
t2=t2-1;
break;
case 3:
A[t3][turno2-1]='O';
t3=t3-1;
break;
case 4:
A[t4][turno2-1]='O';
t4=t4-1;
break;
case 5:
A[t5][turno2-1]='O';
t5=t5-1;
break;
case 6:
A[t6][turno2-1]='O';
t6=t6-1;
break;
case 7:
A[t7][turno2-1]='O';
t7=t7-1;
break;
}
for(X=0;X<=5;X++)
{
for(Y=0;Y<=6;Y++)
{
}
printf("\n ---------------------------\n"); }
//gano?
for(X=0;X<=5;X++)
{
for(Y=0;Y<=6;Y++)
{
if(A[X][Y]=='O' & A[X][Y+1]=='O' & A[X][Y+2]=='O' & A[X][Y+3]=='O'||A[X][Y]=='O' & A[X][Y-1]=='O' & A[X][Y-2]=='O' & A[X][Y-3]=='O'||A[X][Y]=='O' & A[X+1][Y]=='O' & A[X+2][Y]=='O' & A[X+3][Y]=='O'||A[X][Y]=='O' & A[X-1][Y]=='O' & A[X-2][Y]=='O' & A[X-3][Y]=='O'||A[X][Y]=='O' & A[X+1][Y+1]=='O' & A[X+2][Y+2]=='O' & A[X+3][Y+3]=='O'||A[X][Y]=='O' & A[X+1][Y-1]=='O' & A[X+2][Y-2]=='O' & A[X+3][Y-3]=='O')
{
w2=w2+1;
}
}
}
}
C=C+1;
if(w1!=0)
{
acabo=1;
}
if(w2!=0)
{
acabo=1;
}
if(C>22)
{
acabo=1;
}
}while(acabo<1);
}