| 8 | public class MinMaxTest { |
| 9 | |
| 10 | @Test |
| 11 | public void mateInOne() { |
| 12 | Board board = new Board(); |
| 13 | board.placeKing(7, 0, Color.BLACK); |
| 14 | board.placeKing(1, 0, Color.WHITE); |
| 15 | board.placeRook(6, 4, Color.WHITE); |
| 16 | board.placeRook(2, 5, Color.WHITE); |
| 17 | System.out.println(board.fenRepresentation()); |
| 18 | System.out.println(board); |
| 19 | Engine engine = new Engine(); |
| 20 | final Evaluation bestMove = engine.minMax(board, 1, 1); |
| 21 | System.out.println(bestMove.getMove()); |
| 22 | System.out.println(bestMove.getScore()); |
| 23 | board.makeMove(bestMove.getMove()); |
| 24 | System.out.println(board); |
| 25 | Assert.assertEquals(bestMove.getMove().target, Cell.get(7, 5)); |
| 26 | Assert.assertTrue(bestMove.getMove().piece.sameType(PieceType.ROOK)); |
| 27 | System.out.println("NODES: " + Engine.nodesEvaluated + " TRANSPOSITIONS: " + engine.transpositionTable.size()); |
| 28 | } |
| 29 | |
| 30 | @Test |
| 31 | public void mateInThree() { |