i want to build a user defined checkers board but when i execute program,he's stuck in a endless loop... he's continously printing @'s
here is code:
#include <stdio.h>
#define WHITE " "
#define BLACK "@"
main()
{
int ZoneX,ZoneY,n,k,i,j;
printf("Give number of fields: "
scanf("%d",&n);
do{
printf("how large(k) are fields? (n*k<40): "
scanf("%d",&k);
}while(n*k>41);
for(ZoneY=0;ZoneY<n;ZoneY++){
for(i=0;i<k;i++){
for(ZoneX=0;ZoneX<n;ZoneX++){
for(j=0;j<k;i++){
if(ZoneX%2==0&&ZoneY%2==0)
printf("%s",BLACK);
else{
if((ZoneX+ZoneY)%2==0)
printf("%s",BLACK);
else
printf("%s",WHITE);
}
}
}
printf("\n"
}
}
}
here is code:
#include <stdio.h>
#define WHITE " "
#define BLACK "@"
main()
{
int ZoneX,ZoneY,n,k,i,j;
printf("Give number of fields: "
scanf("%d",&n);
do{
printf("how large(k) are fields? (n*k<40): "
scanf("%d",&k);
}while(n*k>41);
for(ZoneY=0;ZoneY<n;ZoneY++){
for(i=0;i<k;i++){
for(ZoneX=0;ZoneX<n;ZoneX++){
for(j=0;j<k;i++){
if(ZoneX%2==0&&ZoneY%2==0)
printf("%s",BLACK);
else{
if((ZoneX+ZoneY)%2==0)
printf("%s",BLACK);
else
printf("%s",WHITE);
}
}
}
printf("\n"
}
}
}