Is this recursive implementation really needed? Wouldn't it be enough to just try the sequence of captures sorted putting the LVA's first? After all we are just playing the captures on a single square, and since this kind of sorting would put bishops and rooks before queens, I can't envision an example in which a "PV" of SEE would not come out sorted this way.Gerd Isenberg wrote: Aha, Zach's code! You are right Sven, should beMay be this pseudo code for a didactic see?Code: Select all
if (see_value + piece_just_captured() >= 0 aka value )
Code: Select all
int see(int square, int side) { value = 0; piece = get_smallest_attacker(square, side); if ( piece ) { make_capture(piece, square); value = max (0, piece_just_captured() -see(square, other(side)) ); undo_capture(piece, square); } return value; }
Am I missing something?
Cheers, Mauro