RomainGoussault / Deepov

C++ Chess Engine
GNU General Public License v2.0
64 stars 15 forks source link

Mate in one not found.. #33

Closed RomainGoussault closed 8 years ago

RomainGoussault commented 8 years ago

Following position: 8/3R4/3p4/3P4/1K4Q1/8/7k/8 w - - 97 104

If white moves the rook it's a win. But Deepov prefers to move the King.

Sample code to test:

MagicMoves::initmagicmoves();
Tables::init();

std::shared_ptr<Board> sp = std::shared_ptr<Board>(new Board("8/3R4/3p4/3P4/1K4Q1/8/7k/8 w - - 97 104"));
Search search(sp);
search.negaMaxRoot(4);
Move move = search.myBestMove;

std::cout << *sp << std::endl;
std::cout << move.toShortString()  << std::endl;
NavidHedjazian commented 8 years ago

Try negaMaxRoot(1). If it works, can we stop the iterative deepening when a mate is found ? For example don't go further when alpha > some value

NavidHedjazian commented 8 years ago

Deepov = noob anyway

RomainGoussault commented 8 years ago

negaMaxRoot(1) does not work because we don't check if black is in check after white's move

RomainGoussault commented 8 years ago

negaMaxRoot(2) and negaMaxRoot(3) work though..

NavidHedjazian commented 8 years ago

Deepov prefers the mate in 2 somehow.

RomainGoussault commented 8 years ago

fixed