Mauritz8 / Vividmind

A UCI-compatible chess engine written from scratch in C++
0 stars 0 forks source link

check if psuedo legal move is legal in search #79

Closed Mauritz8 closed 11 months ago

Mauritz8 commented 11 months ago

currently it loops through all the psuedo legal moves and checks if they leave the king in check, and only those that do not are sent to the search. It would be much more efficient to see if each move leaves the king in check in the search, since a lot of moves are pruned anyways.

Mauritz8 commented 11 months ago

This is how fast it is before implementation: image

Mauritz8 commented 11 months ago

And this is after implementing it: image

It made a huge difference! When I implement better move ordering, this effect will be even more significant, since more moves will be pruned.