Skip to content

Commit

Permalink
fixed problems
Browse files Browse the repository at this point in the history
  • Loading branch information
skviropitek committed May 6, 2024
1 parent 99a9c89 commit 49a0119
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/main/java/core/basesyntax/RobotRoute.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,15 @@ public void moveRobot(Robot robot, int toX, int toY) {
while (robot.getDirection() != Direction.RIGHT) {
robot.turnRight();
}
}
else if (currentX > toX) {
} else if (currentX > toX) {
while (robot.getDirection() != Direction.LEFT) {
robot.turnLeft();
}
}
else if (currentY < toY) {
} else if (currentY < toY) {
while (robot.getDirection() != Direction.UP) {
robot.turnLeft();
}
}
else if (currentY > toY) {
} else if (currentY > toY) {
while (robot.getDirection() != Direction.DOWN) {
robot.turnLeft();
}
Expand Down

0 comments on commit 49a0119

Please sign in to comment.