Created
December 2, 2016 06:24
-
-
Save addcninblue/4b29031c558adcf3151561ee5f863f05 to your computer and use it in GitHub Desktop.
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 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