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

Method mateInOne

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 9

placeKingMethod · 0.95
placeRookMethod · 0.95
fenRepresentationMethod · 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