コード例 #1
0
 @Test
 public void blackKnightForksKingAndRook() throws Exception {
   gameState =
       gameState
           .getBuilder()
           .setActivePieces(Color.BLACK)
           .setPiece(Piece.BLACK_KING, Square.E8)
           .setPiece(Piece.BLACK_KNIGHT, Square.D3)
           .setPiece(Piece.WHITE_KING, Square.E6)
           .setPiece(Piece.WHITE_ROOK, Square.H3)
           .build();
   final Move move = negamax.findBestMove(gameState);
   assertEquals(Square.F4, ((ChessMove) move).getEndSquare());
 }
コード例 #2
0
 @Test
 public void blackBishopForksKingAndRook() throws Exception {
   gameState =
       gameState
           .getBuilder()
           .setActivePieces(Color.BLACK)
           .setPiece(Piece.BLACK_KING, Square.C8)
           .setPiece(Piece.BLACK_BISHOP, Square.G6)
           .setPiece(Piece.WHITE_KING, Square.C6)
           .setPiece(Piece.WHITE_ROOK, Square.H1)
           .build();
   final Move move = negamax.findBestMove(gameState);
   assertEquals(Square.E4, ((ChessMove) move).getEndSquare());
 }