assertEquals(0, new MoveGenerator(board).getAllRemainingMoves().size());
}
@Test
public void test3RepeatDrawDetect() {
BitBoard bitBoard = FENUtils.getBoard("8/7k/8/8/8/8/PPP4K/5Q2 w - - 0 1");
bitBoard.makeMove(BitBoard.generateMove(
BitBoard.coordToPosition("H2"), BitBoard.coordToPosition("H1"), Piece.WHITE, Piece.KING));
bitBoard.makeMove(BitBoard.generateMove(
BitBoard.coordToPosition("H7"), BitBoard.coordToPosition("H8"), Piece.BLACK, Piece.KING));
bitBoard.makeMove(BitBoard.generateMove(
BitBoard.coordToPosition("H1"), BitBoard.coordToPosition("H2"), Piece.WHITE, Piece.KING));
bitBoard.makeMove(BitBoard.generateMove(
BitBoard.coordToPosition("H8"), BitBoard.coordToPosition("H7"), Piece.BLACK, Piece.KING));
bitBoard.makeMove(BitBoard.generateMove(
BitBoard.coordToPosition("H2"), BitBoard.coordToPosition("H1"), Piece.WHITE, Piece.KING));
bitBoard.makeMove(BitBoard.generateMove(
BitBoard.coordToPosition("H7"), BitBoard.coordToPosition("H8"), Piece.BLACK, Piece.KING));
bitBoard.makeMove(BitBoard.generateMove(
BitBoard.coordToPosition("H2"), BitBoard.coordToPosition("H1"), Piece.WHITE, Piece.KING));
// Now, Kh8 draws against K+Q...
assertEquals("H8H7", new ChessEngine().getPreferredMove(bitBoard));
bitBoard.makeMove(BitBoard.generateMove(
BitBoard.coordToPosition("H8"), BitBoard.coordToPosition("H7"), Piece.BLACK, Piece.KING));
assertEquals(3, bitBoard.getRepeatedCount());
}