futility pruning

Discussion of chess software programming and technical issues.

Moderators: hgm, Dann Corbit, Harvey Williamson

flok

Re: futility pruning

Post by flok »

What of these are positional and which are tactical?

- 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
User avatar
Rebel
Posts: 6946
Joined: Thu Aug 18, 2011 12:04 pm

Re: futility pruning

Post by Rebel »

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?
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.

Thereafter you will to figure out how to deal with subtract_checks :wink: