| 43 | } |
| 44 | |
| 45 | @Test |
| 46 | public void mateInTwo() { |
| 47 | Board board = Board.getBoard("7k/4K2p/5p1N/8/8/8/8/8 w - - 0 2"); |
| 48 | System.out.println(board); |
| 49 | Engine engine = new Engine(); |
| 50 | final Evaluation bestMove = engine.minMax(board, 3, 3); |
| 51 | System.out.println(bestMove.getMove()); |
| 52 | System.out.println(bestMove.getScore()); |
| 53 | board.makeMove(bestMove.getMove()); |
| 54 | System.out.println(board); |
| 55 | Assert.assertEquals(bestMove.getMove().target, Cell.get(7, 5)); |
| 56 | Assert.assertTrue(bestMove.getMove().piece.sameType(PieceType.KING)); |
| 57 | System.out.println("NODES: " + Engine.nodesEvaluated + " TRANSPOSITIONS: " + engine.transpositionTable.size()); |
| 58 | } |
| 59 | |
| 60 | @Test |
| 61 | public void complexPosition() { |