Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void moveRobot(RobotConnectionManager robotConnectionManager, int toX, int toY) {
- RobotConnection a;
- for(int i = 0; i < 3; i++)
- {
- try{
- a = robotConnectionManager.getConnection();
- a.moveRobotTo(toX, toY);
- if(i != 2)
- a = robotConnectionManager.getConnection();
- break;
- }
- catch(RobotConnectionException e)
- {
- a.close();
- }
- catch(Exception e)
- {
- throw(e);
- //break;
- }
- finally
- {
- a.close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement