MCPcopy Index your code
hub / github.com/coding-parrot/chess-engine / mateInTwo

Method mateInTwo

src/test/java/MinMaxTest.java:45–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 7

getBoardMethod · 0.95
minMaxMethod · 0.95
getMoveMethod · 0.95
getScoreMethod · 0.95
makeMoveMethod · 0.95
getMethod · 0.95
sameTypeMethod · 0.80

Tested by

no test coverage detected