Ejemplo n.º 1
0
  @Test
  public void testeExemploOitoJogadas() {
    List<Piece> pieces = this.getPieces("2 3 4 5 1 13 14 6 12 11 15 0 10 9 8 7");

    TreeController ctrl = new TreeController(new Root(new Board(pieces)));
    assertEquals(ctrl.calculateMinPlays(), 8);
  }
Ejemplo n.º 2
0
  @Test
  public void testeExemploQuarentaESeisJogadas() {
    List<Piece> pieces = this.getPieces("12 9 7 2 10 14 0 3 13 4 1 8 6 11 5 15");

    TreeController ctrl = new TreeController(new Root(new Board(pieces)));

    assertEquals(46, ctrl.calculateMinPlays());
  }
Ejemplo n.º 3
0
  @Test
  public void testeExemploQuarentaEUmaJogadas() {
    List<Piece> pieces = this.getPieces("0 4 6 13 2 5 3 7 1 11 14 8 12 15 9 10");

    TreeController ctrl = new TreeController(new Root(new Board(pieces)));

    assertEquals(41, ctrl.calculateMinPlays());
  }
Ejemplo n.º 4
0
  @Test
  public void testeExemploTrintaESeisJogadas() {
    List<Piece> pieces = this.getPieces("12 1 5 4 9 14 6 10 3 15 13 2 11 8 0 7");

    TreeController ctrl = new TreeController(new Root(new Board(pieces)));

    assertEquals(36, ctrl.calculateMinPlays());
  }
Ejemplo n.º 5
0
  @Test
  public void testeExemploVinteEOitoJogadas() {
    List<Piece> pieces = this.getPieces("2 4 5 6 0 3 14 13 1 11 9 7 12 15 10 8");

    TreeController ctrl = new TreeController(new Root(new Board(pieces)));

    assertEquals(28, ctrl.calculateMinPlays());
  }
Ejemplo n.º 6
0
  @Test
  public void testeExemploTrezeJogadas() {
    List<Piece> pieces = this.getPieces("2 3 4 5 1 13 14 6 0 11 15 7 12 10 9 8");

    TreeController ctrl = new TreeController(new Root(new Board(pieces)));

    assertEquals(13, ctrl.calculateMinPlays());
  }
Ejemplo n.º 7
0
  @Test
  public void testeExemploQuarentaEOitoJogadas() {
    List<Piece> pieces = this.getPieces("14 13 7 8 5 2 15 3 12 6 4 9 10 1 0 11");

    TreeController ctrl = new TreeController(new Root(new Board(pieces)));

    assertEquals(48, ctrl.calculateMinPlays());
  }
Ejemplo n.º 8
0
  @Test
  public void tabuleiroResolvidoZeroJogadas() {
    List<Piece> pieces = this.getPieces("1 2 3 4 12 13 14 5 11 0 15 6 10 9 8 7");

    Board board = new Board(pieces);
    Root root = new Root(board);
    TreeController ctrl = new TreeController(root);
    assertEquals(ctrl.calculateMinPlays(), 0);
  }