Hi I keep getting Wa on this code

Please help. Thanks in advance.
#include <stdio.h>
char chess[60][60];
char is_sub_check(int x, int y,int dx,int dy, char sub,char uk)
{
int sx,sy,i1;
for(sx=x,sy=y,i1=0;i1<10;i1++)
{
sx+=dx;
sy+=dy;
if(chess[sx][sy]!='.')
{
if(chess[sx][sy]==('q'-sub))
return 1;
else if((uk==1) && (chess[sx][sy]==('b'-sub)))
return 1;
else if((uk==0) && (chess[sx][sy]==('r'-sub)))
return 1;
else
return 0;
}
}
return 0;
}
char is_knight(int x, int y, char k)
{
int i1;
char chk1[]={2,2,-2,-2,1,1,-1,-1};
char chk2[]={1,-1,1,-1,2,-2,2,-2};
for(i1=0;i1<8;i1++)
{
if(chess[x+chk1[i1]][y+chk2[i1]]==k)
return 1;
}
return 0;
}
char is_check(int x, int y, int pl)
{
int sub;
int i1;
char chk1[]={1,-1,1,-1,0,0,1,-1};
char chk2[]={1,-1,-1,1,1,-1,0,0};
if(pl==0)
sub=0x20;
else
sub=0;
if(pl==0)
{
if((chess[x+1][y-1]==('P')) || (chess[x+1][y+1]==('P')))
return 1;
}
else
{
if((chess[x-1][y-1]==('p')) || (chess[x-1][y+1]==('p')))
return 1;
}
if(is_knight(x,y,'n'-sub)==1)
return 1;
for(i1=0;i1<8;i1++)
{
if(is_sub_check(x,y,chk1[i1],chk2[i1],sub,i1<4))
return 1;
}
return 0;
}
int main(int argc, char *argv[])
{
char ch;
char ala;
char jasio[1000];
char X,x,Y,y,licz;
int i1,i2,i3,i4;
licz=0;
while(1)
{
X=Y=x=y=-1;
ala=0;
i1=0;
while(i1<(8*8))
{
ch=getchar();
switch(ch)
{
case 'K':
X=i1/8;
Y=i1%8;
chess[20+i1/8][20+i1%8]=ch;
i1++;
ala=1;
break;
case 'k':
x=i1/8;
y=i1%8;
chess[20+i1/8][20+i1%8]=ch;
i1++;
ala=1;
break;
case 'p':
case 'P':
case 'n':
case 'N':
case 'b':
case 'B':
case 'r':
case 'R':
case 'q':
case 'Q':
ala=1;
case '.':
chess[20+i1/8][20+i1%8]=ch;
i1++;
break;
default:
if(isspace(ch)==0)
{
sleep(12);
exit(0);
}
}
}
if((x == -1) || (X == -1) || (y == -1) || (Y == -1))
return 0;
licz++;
if(ala==0)
break;
if(is_check(20+X,20+Y,1)==1)
printf("Game #%d: white king is in check.\n",licz);
else if(is_check(20+x,20+y,0)==1)
printf("Game #%d: black king is in check.\n",licz);
else
printf("Game #%d: no king is in check.\n",licz);
}
return 0;
}