diff options
| author | mo khan <mo@mokhan.ca> | 2019-08-04 17:30:14 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2019-08-04 17:30:14 -0600 |
| commit | 3c90bf05bbce9d4bcb08cce2ec1f6407fc2b6a26 (patch) | |
| tree | 74ea16233b541888d968856d31f27ace1d6ac213 /src/Q9/Robot.java | |
| parent | f876a60babea196af5592c52f6e1b21ed63850e5 (diff) | |
add classes as per prescribed class diagram
Diffstat (limited to 'src/Q9/Robot.java')
| -rw-r--r-- | src/Q9/Robot.java | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/Q9/Robot.java b/src/Q9/Robot.java new file mode 100644 index 0000000..6d004f0 --- /dev/null +++ b/src/Q9/Robot.java @@ -0,0 +1,35 @@ +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 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; + } +} |
