Commit 3c90bf0
Changed files (2)
src
src/Q9/MovingRobot.java
@@ -0,0 +1,28 @@
+package Q9;
+
+import java.util.*;
+
+public class MovingRobot {
+ private ArrayList<Integer> moves = new ArrayList<Integer>();
+ private int nextMove;
+
+ public MovingRobot(int x, int y) {}
+
+ public boolean validateNextMove() {
+ return false;
+ }
+
+ public int generateNextMove() {
+ return 0;
+ }
+
+ public static boolean sameSlot(Robot r1, Robot r2) {
+ return false;
+ }
+
+ public String printMoves() {
+ return "";
+ }
+
+ public void move() {}
+}
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;
+ }
+}