示例#1
0
  /**
   * Test single critter walking a spiral
   *
   * @throws SyntaxError
   * @throws IOException
   */
  @Test
  public void testThousandSteps() throws IOException, SyntaxError {
    World w = new World();
    Critter.loadCrittersIntoWorld(w, "txt/ThousandSteps/critter.txt", 200, session_id);
    Food.loadFoodIntoWorld(w, 10, 20);
    w.printASCIIMap();

    for (int i = 0; i < 1000; ++i) {
      w.lapse();
      assertTrue(w.getTurns() == i + 1);
      if (i % 100 == 0) {
        System.out.println(i + "th iteration");
        System.out.println("there are " + w.order.size() + " critters in the world");
        w.printASCIIMap();
        System.out.println("\n \n ");
      }
    }
  }