forked from lordoz234/Lab_work
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathYurkin.c
40 lines (38 loc) · 781 Bytes
/
Yurkin.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <stdio.h>
#include <stdlib.h>
void main(){
printf("input your coordinates:");
int x1,y1,x2,y2;
scanf ("%d %d %d %d",&x1, &y1, &x2, &y2);
if (abs(y1-y2)<=1 && abs(x1-x2)<=1){
printf("King +");
}
else{printf("King -");
}
if (x1==x2 || y1==y2){
printf("Ladya +");
}
else{
printf("Ladya -");
}
if ((abs(x1-x2))<=7 && (abs(y1-y2))<=7){
printf("Ferz +");
}
else{
printf("Ferz -");
}
for(int i=1;i<=8;i++){
if(abs(x1-x2)==i && abs(y1-y2)==i){
printf("Slon +");
}
else{
printf("Slon -");
}
}
if((x1+1==x2&&y1+2==y2)||(x1+2==x2&&y1+1==y2)||(x1-1==x2&&y1+2==y2)||(x1-1==x2&&y1-2==y2)||(x1+1==x2&&y1-2==y2)||(x1-2==x2&&y1+1==y2||(x1-2==x2&&y1-1==y2)||(x1+2==x2&&y1-1==y2))){
printf("Kon +");
}
else{
printf("Kon -");
}
}