Skip to content

Commit

Permalink
getDirAection -- fix
Browse files Browse the repository at this point in the history
  • Loading branch information
acidcor committed Dec 15, 2024
1 parent 9014219 commit c02f609
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/core/basesyntax/RobotRoute.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public void moveRobot(Robot robot, int toX, int toY) {
int startX = robot.getX();
int startY = robot.getY();
if (startX <= toX & startY <= toY) {
switch (robot.getDiraection()) {
switch (robot.getDirection()) {
case LEFT:
robot.turnRight();
while (robot.getY() != toY) {
Expand Down Expand Up @@ -49,7 +49,7 @@ public void moveRobot(Robot robot, int toX, int toY) {
}
}
if (startX >= toX & startY >= toY) {
switch (robot.getDiraection()) {
switch (robot.getDirection()) {
case LEFT:
while (robot.getX() != toX) {
robot.stepForward();
Expand Down Expand Up @@ -91,7 +91,7 @@ public void moveRobot(Robot robot, int toX, int toY) {
}
}
if (startX >= toX & startY <= toY) {
switch (robot.getDiraection()) {
switch (robot.getDirection()) {
case LEFT:
while (robot.getX() != toX) {
robot.stepForward();
Expand Down Expand Up @@ -133,7 +133,7 @@ public void moveRobot(Robot robot, int toX, int toY) {
}
}
if (startX <= toX & startY >= toY) {
switch (robot.getDiraection()) {
switch (robot.getDirection()) {
case LEFT:
robot.turnLeft();
while (robot.getY() != toY) {
Expand Down

0 comments on commit c02f609

Please sign in to comment.