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

Method mateIn4

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 6

getBoardMethod · 0.95
alphaBetaMethod · 0.95
getMoveMethod · 0.95
getMethod · 0.95
getScoreMethod · 0.95
sameTypeMethod · 0.80

Tested by

no test coverage detected