| 112 | } |
| 113 | |
| 114 | @Test |
| 115 | public void mateIn4() { |
| 116 | Board board = Board.getBoard("7R/r1p1q1pp/3k4/1p1n1Q2/3N4/8/1PP2PPP/2B3K1 w - - 1 0"); |
| 117 | System.out.println(board); |
| 118 | Engine engine = new Engine(); |
| 119 | final OutCome bestMove = engine.alphaBeta(board, 7, Integer.MIN_VALUE, Integer.MAX_VALUE, 7); |
| 120 | System.out.println(bestMove.getMove()); |
| 121 | Assert.assertEquals(Cell.get(7, 3), bestMove.getMove().target); |
| 122 | Assert.assertTrue(bestMove.getMove().piece.sameType(PieceType.ROOK)); |
| 123 | Assert.assertEquals(Integer.MIN_VALUE, bestMove.getScore(), 0.000001); |
| 124 | System.out.println("NODES: " + Engine.nodesEvaluated + " TRANSPOSITIONS: " + engine.transpositionTable.size()); |
| 125 | } |
| 126 | |
| 127 | @Test |
| 128 | public void countMovesAtPosition4MinMax() { |