blob: 69ef0a5a3b3e7987ebaab7e746e08ece25e80d99 (
plain)
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
40
41
42
43
44
45
|
package Q9;
public class Robot {
private int x;
private int y;
public static final int UP = 1;
public static final int DOWN = 2;
public static final int LEFT = 3;
public static final int RIGHT = 4;
public static final int LEFT_UP_CORNER = 5;
public static final int LEFT_DOWN_CORNER = 6;
public static final int RIGHT_UP_CORNER = 7;
public static final int RIGHT_DOWN_CORNER = 8;
public static final int NORTH = UP;
public static final int NORTH_EAST = RIGHT_UP_CORNER;
public static final int EAST = RIGHT;
public static final int SOUTH_EAST = RIGHT_DOWN_CORNER;
public static final int SOUTH = DOWN;
public static final int SOUTH_WEST = LEFT_DOWN_CORNER;
public static final int WEST = LEFT;
public static final int NORTH_WEST = LEFT_UP_CORNER;
public Robot(int x, int y) {
this.x = x;
this.y = y;
}
public int getX() {
return x;
}
public int getY() {
return y;
}
public void setX(int x) {
this.x = x;
}
public void setY(int y) {
this.y = y;
}
}
|