Skip to content

Commit

Permalink
Implemented moveRobot method
Browse files Browse the repository at this point in the history
  • Loading branch information
SSXcorp committed Dec 3, 2024
1 parent 099872b commit 39a83df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/core/basesyntax/RobotRoute.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static int setDirectionAndStepsX(Robot robot, int toX) {
robot.turnRight();
}
}
return Math.max(robot.getX(), toX) - Math.min(robot.getX(), toX); // returns amount of steps
return Math.max(robot.getX(), toX) - Math.min(robot.getX(), toX);
}

public static int setDirectionAndStepsY(Robot robot, int toY) {
Expand All @@ -37,6 +37,6 @@ public static int setDirectionAndStepsY(Robot robot, int toY) {
robot.turnRight();
}
}
return Math.max(robot.getY(), toY) - Math.min(robot.getY(), toY); // returns amount of steps
return Math.max(robot.getY(), toY) - Math.min(robot.getY(), toY);
}
}

0 comments on commit 39a83df

Please sign in to comment.