- position value (piece x on position y) - rather obvious
- SUM(eval piece * number of pieces)
- number of isolated pawns
- number of double pawns
- mobility
- passed pawns
Moderators: hgm, Dann Corbit, Harvey Williamson
You can use the Paul Verhelst way. In a nutshell, subtract the enemy_king_square from the to_square and use the unsigned value as an entry to a 256 byte table. If the table returns a "0" the move impossibly can give a check which statistically is most of the time. So with 2 C-instructions + an intelligent table you already catched most cases. Define the rest of the table entries with their corresponding direction and depending on the piece type check if it can capture the enemy king.flok wrote:Next question: determing if a move gives check. I think that is a makeMove(), then generate a list of moves, validate which ones are correct and then see if the opponent is in check state. This feels expensive? Or are here smarter ways of finding if a move gives check?