Skip to content

Instantly share code, notes, and snippets.

@addcninblue
Created December 2, 2016 06:24
Show Gist options
  • Save addcninblue/4b29031c558adcf3151561ee5f863f05 to your computer and use it in GitHub Desktop.
Save addcninblue/4b29031c558adcf3151561ee5f863f05 to your computer and use it in GitHub Desktop.
public class main {
public static void main (String [] args){
Robot robot;
robot = new Robot(new int[]{1,1,2,2}, 1, true);
checkEquals(robot.clearHall(), 9, 5);
robot = new Robot(new int[]{1,1,2,2}, 1, false);
checkEquals(robot.clearHall(), 8, 8);
robot = new Robot(new int[]{1,1,1,1}, 0, true);
checkEquals(robot.clearHall(), 4, 11);
}
public static void checkEquals(int one, int two, int lineNumber){
if(one != two){
System.out.format("Error in line %d.\n", lineNumber);
System.out.format("Your output: %d.\n", one);
System.out.format("Expected output: %d.\n", two);
} else {
System.out.println("Passed.");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment