chesslablab / php-chess

A chess library for PHP offering move validation, common formats, multiple variants, UCI engine support, explanation of chess positions, and image recognition.
https://chesslablab.github.io/php-chess/
MIT License
110 stars 52 forks source link

feat: implement `DeflectionEval` #579

Closed KartikWatts closed 2 months ago

KartikWatts commented 2 months ago

closes #458

This PR implements TDD for DeflectionEval

programarivm commented 2 months ago

Thank you @KartikWatts for contributing to this repo.

The implementation of the deflection heuristic is not too obvious at all. Also I am still trying to understand what it is about. It seems as if this one is often used as part of a combination involving other tactics like overloaded pieces and the back-rank checkmate.

@gurpreetkaits how about the implementation of Chess\Eval\BackRankEval?

Happy learning!

gurpreetkaits commented 2 months ago

Hi, Happy Coding!!

I'll be back to the work this weekend.

KartikWatts commented 2 months ago

@programarivm If the PR is closed, I would appreciate it if closed with a comment 🙂, efforts were put into it. Thanks.

programarivm commented 2 months ago

Thank you @KartikWatts for asking this question.

The deflecion heuristic is probably one of the most complicated until now.

Let's stick to this definition:

Deflection is a tactic that forces an opposing piece to leave an important square. Deflections are often used as part of a combination which involves other tactics as well, typically piece overloading and the back-rank checkmate.

Chess\Eval\OverloadingEval is already implemented. The next thing to do is to implement Chess\Eval\BackRankEval.

Please let me know if you'd want to be assigned https://github.com/chesslablab/php-chess/issues/467

Happy coding and learning!