#include
int main()
{
int x,y,movement=0,a,b;
printf("Enter position of the bishop\n");
scanf("%d%d",&x,&y);
if(x>8||y>8)
printf("max possible co-ordinate are 8\n");
else{
a=x;
b=y;
while(x<8&&y<8) x="a;" y="b;">1)
{
x++;
y--;
movement++;
}
x=a;
y=b;
while(x>1&&y>1)
{
x--;
y--;
movement++;
}
x=a;
y=b;
while(x>1&&y<8)
{
x--;
y++;
movement++;
}
printf("no of movements possible for bishop = %d\n",movement);
}
}
int main()
{
int x,y,movement=0,a,b;
printf("Enter position of the bishop\n");
scanf("%d%d",&x,&y);
if(x>8||y>8)
printf("max possible co-ordinate are 8\n");
else{
a=x;
b=y;
while(x<8&&y<8) x="a;" y="b;">1)
{
x++;
y--;
movement++;
}
x=a;
y=b;
while(x>1&&y>1)
{
x--;
y--;
movement++;
}
x=a;
y=b;
while(x>1&&y<8)
{
x--;
y++;
movement++;
}
printf("no of movements possible for bishop = %d\n",movement);
}
}
why this program will not run in my pc...
ReplyDeleteThanks for sharing nice information with us.my hobbies are chess and programming i like your post and all you share with us is uptodate and quite informative, i would like to bookmark the page so i can come here again to read you, as you have done a wonderful job.
ReplyDelete