Skip to content

Commit

Permalink
found !
Browse files Browse the repository at this point in the history
  • Loading branch information
Povch Anastasia committed Jan 2, 2025
1 parent 1ce19ef commit 77d712f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/java/core/basesyntax/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
public class Main {
public static void main(String[] args) {
Robot robot = new Robot(Direction.LEFT, -3, -4);
robot.turnLeft();
RobotRoute.moveRobot (robot, 2, 5);
System.out.println("Robot is located at position: (" + robot.getX() + ", " + robot.getY() + ")");
System.out.println("Robot's direction is: " + robot.getDirection());
Expand Down
1 change: 0 additions & 1 deletion src/main/java/core/basesyntax/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public int getY() {
return coordinateY;
}


public void turnLeft() {
switch (direction) {

Expand Down
1 change: 1 addition & 0 deletions src/main/java/core/basesyntax/RobotRoute.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public static void moveRobot(Robot robot, int toX, int toY) {
while (robot.getDirection() != Direction.RIGHT) {
robot.turnRight();
}

robot.stepForward();
} else {
while (robot.getDirection() != Direction.LEFT) {
Expand Down

0 comments on commit 77d712f

Please sign in to comment.