Created
September 23, 2016 14:40
-
-
Save ilya-afanasev/1215340985c128165cd27183b72f7dad to your computer and use it in GitHub Desktop.
java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void moveRobot(RobotConnectionManager robotConnectionManager, int toX, int toY) { | |
for(int i = 0; i < 3; ++i){ | |
try(RobotConnection conn = robotConnectionManager.getConnection();){ | |
conn.moveRobotTo(toX, toY); | |
return; | |
}catch(RobotConnectionException ex){} | |
} | |
throw new RobotConnectionException("Close connection"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment