diff --git a/src/main/java/core/basesyntax/RobotRoute.java b/src/main/java/core/basesyntax/RobotRoute.java index b6cbb2bf..cd35bcf1 100644 --- a/src/main/java/core/basesyntax/RobotRoute.java +++ b/src/main/java/core/basesyntax/RobotRoute.java @@ -5,20 +5,16 @@ public class RobotRoute { public void moveRobot(Robot robot, int toX, int toY) { while (robot.getX() != toX) { if (robot.getX() < toX) { - while (robot.getDirection() != Direction.RIGHT) { robot.turnRight(); } } else { - while (robot.getDirection() != Direction.LEFT) { robot.turnLeft(); } } robot.stepForward(); } - - while (robot.getY() != toY) { if (robot.getY() < toY) { diff --git a/src/main/java/core/basesyntax/main.java b/src/main/java/core/basesyntax/main.java index 5741a2e2..4f84de18 100644 --- a/src/main/java/core/basesyntax/main.java +++ b/src/main/java/core/basesyntax/main.java @@ -1,7 +1,7 @@ package core.basesyntax; public class main { - public static void main(String[] args) { + public static void Main(String[] args) { Robot robot = new Robot(Direction.RIGHT, 0, 0); RobotRoute robotRoute = new RobotRoute(); robotRoute.moveRobot(robot, 3, 2);