Exemplo n.º 1
0
 @Test
 public void testRecursiveBacktrackerMazeGenerator() {
   final RecursiveBacktrackerMazeGenerator mazeGenerator =
       new RecursiveBacktrackerMazeGenerator(randomGenerator);
   grid.getTopLeftSquare().setState(MazeDefinitionState.ENTRANCE, true);
   mazeGenerator.generateMaze(grid);
 }
Exemplo n.º 2
0
 @Test
 public void testAldousBroderMazeGenerator() {
   final AldousBroderMazeGenerator mazeGenerator = new AldousBroderMazeGenerator(randomGenerator);
   grid.getTopLeftSquare().setState(MazeDefinitionState.ENTRANCE, true);
   mazeGenerator.generateMaze(grid);
   // assertTrue(new RecursiveBacktrackerSolver().solve(new
   // Graph.UtilityWrapper(grid).getEntrance()));
 }
Exemplo n.º 3
0
 @Test
 public void testWallSetup() {
   assertTrue(
       grid.getSquare(new Position(1, 1)).getWall(RIGHT)
           == grid.getSquare(new Position(2, 1)).getWall(LEFT));
 }
Exemplo n.º 4
0
 @Test
 public void testMatrixStorage() {
   grid.getSquare(new Position(4, 3)).setState(15, true);
   assertTrue(mazeMatrix.get(new Position(4 * 2 + 1, 3 * 2 + 1)).hasState(15));
 }
Exemplo n.º 5
0
 @Test
 public void testKruskalMazeGenerator() {
   final KruskalMazeGenerator mazeGenerator = new KruskalMazeGenerator(randomGenerator);
   grid.getTopLeftSquare().setState(MazeDefinitionState.ENTRANCE, true);
   mazeGenerator.generateMaze(grid);
 }