Beispiel #1
0
 public static void testBroken() {
   int[][] s = {
     {1, 0, 0, 0},
     {1, 1, 1, 0},
     {1, 1, 1, 1}
   };
   Robot r = TestHelper.makeBot(s);
   ExpandAll e = new ExpandAll(r);
   TestHelper.runMove(e);
   r.drawUnit();
 }
Beispiel #2
0
  public static void testMove(int w, int h) {
    int[][] start = new int[h][w];
    for (int i = 0; i < h; i++) {
      for (int j = 0; j < w; j++) {
        start[i][j] = 1;
      }
    }

    int[][] finish = new int[w][h];
    for (int i = 0; i < w; i++) {
      for (int j = 0; j < h; j++) {
        finish[i][j] = 1;
      }
    }

    Robot r = TestHelper.makeBot(start);
    Staircase s = new Staircase(r, r.toModuleArray()[0][0], h, w);
    TestHelper.runAndDisplayMove(s);
    TestHelper.validateOutput(r, TestHelper.makeBot(finish));
  }