Open UlisseMini opened 3 years ago
The function is also used incorrectly in sort_by_promise. It uses the current legal moves which are nonzero, so it will never account for checkmate.
Unfortunately, the speed decrease from running movegen on all legal moves is unacceptable. So we'll need to come up with a faster solution.
I've mostly fixed it by passing game_over: bool
instead. Still need to fix the issue with mates. (computing if there is a checkmate should be a quick operation with bitboards.)
Currently,
eval::get_score
takes in aBoard
andnum_legal_moves
. This is ugly and the code is not readable. This could be fixed by movingnum_legal_moves
into theBoard
struct and have it be cached, or perhaps something else.