I've been away from chess programming for a while, but I'm still stuck on SEE.

Every time I try to resolve something I seem to open a new can of worms.

I planned on using an iterative static exchange evaluation following the psuedo code:

Code: Select all

```
int staticexchangeevaluationw ( const int from , const int to )
{
int iteration ;
int valuelist[ 3 2 ] ;
int next ;
int valueattacker ;
// iteration for White
iteration=0;
valuelist[iteration] = boardvalue ( to ) ;
next = from ;
generateattackers ( next , to ) ;
if ( blackattackers( ) == 0 ) return boardvalue ( t o ) ;
valueattacker = boardvalue ( from ) ;
// forward−iterationloop : ( 1 ) fill the valuelist
while ( true )
{
// iteration for Black
iteration ++;
valuelist[ iteration ]= valueattacker −valuelist [iteration− 1 ] ;
next = nextblackattacker ( ) ;
updatexrayattackers ( next , t o ) ;
if ( whiteattackers( ) == 0 ) break ;
valueattacker = board value ( next ) ;
//iteration for White
iteration ++;
valuelist [iteration ]= valueattacker −valuelist [iteration − 1 ] ;
next = nextwhiteattacker ( ) ;
updatexrayattackers( next , t o ) ;
if ( blackattackers( ) == 0 ) break ;
valueattacker = board value ( next ) ;
}
// reverse −iteration loop : ( 2 ) evaluate the valuelist
while ( true )
{
if( iteration == 0 ) return valuelistt [ 0 ] ;
if ( valuelist [iteration ] > − valuelist [ iiteration −1])
{
valuelist [iteration −1] = −valuelist [iteration ] ;
}
iteration −−;
}
}
```

I have had a few ideas but they all seem problematic.

Any advice would be grateful, thanks.