Package nl.zoidberg.calculon.engine

Examples of nl.zoidberg.calculon.engine.PawnCaptureGenerator


 
    @Test
  public void pawnCaptures() {
    BitBoard board = FENUtils.getBoard("7k/7p/8/bp1n2P1/1PP1P3/8/8/7K w - - 0 1");
    List<BitBoardMove> rv = new ArrayList<BitBoardMove>();
    new PawnCaptureGenerator().generateMoves(board, false, -1L, rv);
    assertEquals(4, rv.size());

    String fen = "7k/7p/8/bp1n2P1/1PP1P3/8/8/7K b - - 0 1";
    board = FENUtils.getBoard(fen);
   
    PGNUtils.applyMove(board, "h5");
    assertTrue(board.isEnPassant());
    assertEquals(7, board.getEnPassantFile());
    assertEquals(5, board.getEnPassantRank());
   
    rv.clear();
    new PawnCaptureGenerator().generateMoves(board, false, -1L, rv);
    assertEquals(5, rv.size());
   
    board = board.reverse();
    rv.clear();
    new PawnCaptureGenerator().generateMoves(board, false, -1L, rv);
    assertEquals(5, rv.size());
    assertTrue(board.isEnPassant());
    assertEquals(7, board.getEnPassantFile());
    assertEquals(2, board.getEnPassantRank());
  }
View Full Code Here

TOP

Related Classes of nl.zoidberg.calculon.engine.PawnCaptureGenerator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.