chesslablab / php-chess

A chess library for PHP offering move validation, data conversion from one format to another, multiple variants, UCI engine support, explanation of chess positions, and image recognition.
https://chesslablab.github.io/php-chess/
MIT License
108 stars 51 forks source link

Fix the attack evaluation feature #132

Closed programarivm closed 3 years ago

programarivm commented 3 years ago

It seems as if the attack evaluation is not being calculated properly when a pawn is threatening a minor piece. Attached below is the heuristic picture obtained after playing 1.e4 Nf6 2.e5.

chessboard (1) Figure 1. 1.e4 Nf6 2.e5.

heuristic-fix Figure 2. This is the heuristic picture obtained.

In this particular example, the Attack evaluation should be nearly 1 rather than 0 as it is plotted at this moment.

Keep it up, and happy learning and coding.

programarivm commented 3 years ago

Committed updates to master.