Skip to content

Instantly share code, notes, and snippets.

View ilya-afanasev's full-sized avatar

ilya-afanasev

View GitHub Profile
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");
}