-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBoolean40.java
More file actions
20 lines (15 loc) · 668 Bytes
/
Boolean40.java
File metadata and controls
20 lines (15 loc) · 668 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package booleans;
import java.util.Scanner;
public class Boolean40 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("1..8 dagi x va y ni kiriting: ");
System.out.println("Dastlabki koordinatasi");
int x1 = scanner.nextInt(), y1 = scanner.nextInt();
System.out.println("Ko'chgan koordinatasi");
int x2 = scanner.nextInt(), y2 = scanner.nextInt();
boolean isBlack = Math.abs(x1 - x2) == 1 && Math.abs(y1 - y2) == 2 ||
Math.abs(x1 - x2) == 2 && Math.abs(y1 - y2) == 1;
System.out.println("Otning yurishi: " + isBlack);
}
}